Skip to content

Commit f7983e4

Browse files
authored
Merge pull request #744 from phaserjs/release/v2.20.1
Phaser CE Version 2.20.1
2 parents 5fe0ba5 + ab70661 commit f7983e4

File tree

224 files changed

+11431
-11136
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

224 files changed

+11431
-11136
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Change Log
22

3-
## Unreleased
3+
## Version 2.20.1 - 5 October 2024
44

55
### Updates
66

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Phaser CE is a fast, free, and fun open source HTML5 game framework. It uses a c
66

77
Phaser CE is based on Phaser v2.6.2 by [Photon Storm](http://www.photonstorm.com). [Phaser v3](http://phaser.io/phaser3) and [Phaser v4](https://github.com/phaserjs/phaser4) are in active development.
88

9-
The [current Phaser CE release is 2.20.0](https://github.com/photonstorm/phaser-ce/releases/tag/v2.20.0).
9+
The [current Phaser CE release is 2.20.1](https://github.com/photonstorm/phaser-ce/releases/tag/v2.20.1).
1010

1111
- **Visit:** The [Phaser website](http://phaser.io) and follow on [Twitter](https://twitter.com/photonstorm) (#[phaserjs](https://twitter.com/hashtag/phaserjs))
1212
- **Learn:** [API Docs](https://phaserjs.github.io/phaser-ce/), [Support Forum][forum] and [StackOverflow](https://stackoverflow.com/questions/tagged/phaser-framework)
@@ -82,19 +82,19 @@ Please see additional steps for [Browserify/CommonJS](#browserify) and [Webpack]
8282
[Phaser CE is on jsDelivr](http://www.jsdelivr.com/projects/phaser-ce). Include the following in your html:
8383

8484
```html
85-
<script src="https://cdn.jsdelivr.net/npm/phaser-ce@2.20.0/build/phaser.js"></script>
85+
<script src="https://cdn.jsdelivr.net/npm/phaser-ce@2.20.1/build/phaser.js"></script>
8686
```
8787

8888
or the minified version:
8989

9090
```html
91-
<script src="https://cdn.jsdelivr.net/npm/phaser-ce@2.20.0"></script>
91+
<script src="https://cdn.jsdelivr.net/npm/phaser-ce@2.20.1"></script>
9292
```
9393

94-
[Custom builds](https://cdn.jsdelivr.net/npm/phaser-ce@2.20.0/build/custom/) are available too, e.g.,
94+
[Custom builds](https://cdn.jsdelivr.net/npm/phaser-ce@2.20.1/build/custom/) are available too, e.g.,
9595

9696
```html
97-
<script src="https://cdn.jsdelivr.net/npm/phaser-ce@2.20.0/build/custom/phaser-arcade-physics.js"></script>
97+
<script src="https://cdn.jsdelivr.net/npm/phaser-ce@2.20.1/build/custom/phaser-arcade-physics.js"></script>
9898
```
9999

100100
<a name="getting-started"></a>
@@ -282,10 +282,10 @@ All rights reserved.
282282

283283
[![Analytics](https://ga-beacon.appspot.com/UA-44006568-2/phaser/index)](https://github.com/igrigorik/ga-beacon)
284284

285-
[get-js]: https://github.com/photonstorm/phaser-ce/releases/download/v2.20.0/phaser.js
286-
[get-minjs]: https://github.com/photonstorm/phaser-ce/releases/download/v2.20.0/phaser.min.js
287-
[get-zip]: https://github.com/photonstorm/phaser-ce/archive/v2.20.0.zip
288-
[get-tgz]: https://github.com/photonstorm/phaser-ce/archive/v2.20.0.tar.gz
285+
[get-js]: https://github.com/photonstorm/phaser-ce/releases/download/v2.20.1/phaser.js
286+
[get-minjs]: https://github.com/photonstorm/phaser-ce/releases/download/v2.20.1/phaser.min.js
287+
[get-zip]: https://github.com/photonstorm/phaser-ce/archive/v2.20.1.zip
288+
[get-tgz]: https://github.com/photonstorm/phaser-ce/archive/v2.20.1.tar.gz
289289
[clone-http]: https://github.com/photonstorm/phaser.git
290290
[clone-ssh]: ssh://git@github.com:photonstorm/phaser.git
291291
[clone-svn]: https://github.com/photonstorm/phaser

build/custom/creature.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/custom/p2.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/custom/phaser-arcade-physics.js

Lines changed: 33 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
* Phaser CE - https://github.com/photonstorm/phaser-ce
99
*
10-
* v2.20.0 "2022-12-10" - Built: Sat Dec 10 2022 07:57:43
10+
* v2.20.1 "2024-10-05" - Built: Sat Oct 05 2024 11:25:47
1111
*
1212
* By Richard Davey http://www.photonstorm.com @photonstorm and Phaser CE contributors
1313
*
@@ -7774,7 +7774,7 @@ var Phaser = Phaser || { // jshint ignore:line
77747774
* @constant Phaser.VERSION
77757775
* @type {string}
77767776
*/
7777-
VERSION: '2.20.0',
7777+
VERSION: '2.20.1',
77787778

77797779
/**
77807780
* AUTO renderer - picks between WebGL or Canvas based on device.
@@ -22024,7 +22024,7 @@ Phaser.Game = function (width, height, renderer, parent, state, transparent, ant
2202422024
this.fpsProblemNotifier = new Phaser.Signal();
2202522025

2202622026
/**
22027-
* @property {boolean} forceSingleUpdate - Use a variable-step game loop (true) or a fixed-step game loop (false).
22027+
* @property {boolean} forceSingleUpdate - Use a variable-step game loop (true) or a fixed-step game loop (false). When false, {@link Phaser.Time#desiredFps} determines the delta size. A fixed-step loop gives more consistent results in physics calculations.
2202822028
* @default
2202922029
* @see Phaser.Time#desiredFps
2203022030
*/
@@ -23506,8 +23506,8 @@ Phaser.Input.prototype = {
2350623506

2350723507
this.activePointer = this.mousePointer;
2350823508

23509-
this.hitCanvas = Phaser.CanvasPool.create(this, 1, 1);
23510-
this.hitContext = this.hitCanvas.getContext('2d');
23509+
this.hitCanvas = Phaser.Canvas.create(undefined, 1, 1, undefined, true);
23510+
this.hitContext = this.hitCanvas.getContext('2d', { willReadFrequently: true });
2351123511

2351223512
if (this.game.device.mspointer && (config.mspointer !== false))
2351323513
{
@@ -23575,7 +23575,7 @@ Phaser.Input.prototype = {
2357523575

2357623576
this.moveCallbacks = [];
2357723577

23578-
Phaser.CanvasPool.remove(this);
23578+
Phaser.Canvas.dispose(this.hitCanvas);
2357923579

2358023580
this.game.canvas.removeEventListener('click', this._onClickTrampoline);
2358123581
},
@@ -49783,8 +49783,8 @@ Phaser.Device._initialize = function ()
4978349783
*/
4978449784
function _checkCanvasFeatures ()
4978549785
{
49786-
var canvas = Phaser.CanvasPool.create(this, 6, 1);
49787-
var context = canvas.getContext('2d');
49786+
var canvas = Phaser.Canvas.create(undefined, 6, 1, undefined, true);
49787+
var context = canvas.getContext('2d', { willReadFrequently: true });
4978849788

4978949789
context.fillStyle = 'rgba(10, 20, 30, 0.5)';
4979049790

@@ -49815,7 +49815,7 @@ Phaser.Device._initialize = function ()
4981549815
context.globalCompositeOperation = 'multiply';
4981649816
device.canUseMultiply = (context.globalCompositeOperation === 'multiply');
4981749817

49818-
Phaser.CanvasPool.removeByCanvas(canvas);
49818+
Phaser.Canvas.dispose(canvas);
4981949819

4982049820
PIXI.CanvasTinter.tintMethod = (device.canUseMultiply) ? PIXI.CanvasTinter.tintWithMultiply : PIXI.CanvasTinter.tintWithPerPixel;
4982149821
}
@@ -50504,6 +50504,21 @@ Phaser.Canvas = {
5050450504
return canvas;
5050550505
},
5050650506

50507+
/**
50508+
* Sets `canvas` dimensions to 1.
50509+
*
50510+
* @method Phaser.Canvas.dispose
50511+
* @param {HTMLCanvasElement} canvas - The canvas to be disposed of.
50512+
* @return {HTMLCanvasElement} The canvas.
50513+
*/
50514+
dispose: function (canvas)
50515+
{
50516+
canvas.width = 1;
50517+
canvas.height = 1;
50518+
50519+
return canvas;
50520+
},
50521+
5050750522
/**
5050850523
* Sets the background color behind the canvas. This changes the canvas style property.
5050950524
*
@@ -63957,7 +63972,7 @@ Phaser.Loader.prototype = {
6395763972
file.data.removeEventListener(file.loadEvent, videoLoadEvent, false);
6395863973
file.data.onerror = null;
6395963974
file.data.canplay = true;
63960-
_this.game.load.fileComplete(file);
63975+
_this.fileComplete(file);
6396163976
};
6396263977

6396363978
file.data.onerror = function ()
@@ -67019,11 +67034,6 @@ Phaser.SoundManager.prototype = {
6701967034
this.setTouchLock();
6702067035
}
6702167036
}
67022-
67023-
if (this.usingWebAudio && device.chrome && device.chromeVersion <= 65)
67024-
{
67025-
console.log('A "GainNode.gain.value setter smoothing is deprecated" notice in Chrome is normal. <https://github.com/photonstorm/phaser-ce/issues/385>');
67026-
}
6702767037
},
6702867038

6702967039
/**
@@ -67645,8 +67655,6 @@ Object.defineProperty(Phaser.SoundManager.prototype, 'mute', {
6764567655

6764667656
set: function (value)
6764767657
{
67648-
value = value || false;
67649-
6765067658
if (value)
6765167659
{
6765267660
if (this._muted)
@@ -75529,6 +75537,8 @@ Phaser.Physics.prototype.constructor = Phaser.Physics;
7552975537
/**
7553075538
* The Arcade Physics world. Contains Arcade Physics related collision, overlap and motion methods.
7553175539
*
75540+
* Set {@link Phaser.Game#forceSingleUpdate} to `false` for better consistency.
75541+
*
7553275542
* @class Phaser.Physics.Arcade
7553375543
* @constructor
7553475544
* @param {Phaser.Game} game - reference to the current game instance.
@@ -75789,22 +75799,24 @@ Phaser.Physics.Arcade.prototype = {
7578975799
{
7579075800
if (max === undefined) { max = 10000; }
7579175801

75802+
var deltaSec = 0.001 * this.game.time.delta;
75803+
7579275804
if (axis === 1 && body.allowGravity)
7579375805
{
75794-
velocity += (this.gravity.x + body.gravity.x) * 0.001 * this.game.time.delta;
75806+
velocity += (this.gravity.x + body.gravity.x) * deltaSec;
7579575807
}
7579675808
else if (axis === 2 && body.allowGravity)
7579775809
{
75798-
velocity += (this.gravity.y + body.gravity.y) * 0.001 * this.game.time.delta;
75810+
velocity += (this.gravity.y + body.gravity.y) * deltaSec;
7579975811
}
7580075812

7580175813
if (acceleration)
7580275814
{
75803-
velocity += acceleration * 0.001 * this.game.time.delta;
75815+
velocity += acceleration * deltaSec;
7580475816
}
7580575817
else if (drag && body.allowDrag)
7580675818
{
75807-
drag *= 0.001 * this.game.time.delta;
75819+
drag *= deltaSec;
7580875820

7580975821
if (velocity - drag > 0)
7581075822
{

build/custom/phaser-arcade-physics.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/custom/phaser-arcade-physics.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/custom/phaser-creature.js

Lines changed: 33 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
* Phaser CE - https://github.com/photonstorm/phaser-ce
99
*
10-
* v2.20.0 "2022-12-10" - Built: Sat Dec 10 2022 07:58:01
10+
* v2.20.1 "2024-10-05" - Built: Sat Oct 05 2024 11:26:10
1111
*
1212
* By Richard Davey http://www.photonstorm.com @photonstorm and Phaser CE contributors
1313
*
@@ -40,7 +40,7 @@ var Phaser = Phaser || { // jshint ignore:line
4040
* @constant Phaser.VERSION
4141
* @type {string}
4242
*/
43-
VERSION: '2.20.0',
43+
VERSION: '2.20.1',
4444

4545
/**
4646
* AUTO renderer - picks between WebGL or Canvas based on device.
@@ -14290,7 +14290,7 @@ Phaser.Game = function (width, height, renderer, parent, state, transparent, ant
1429014290
this.fpsProblemNotifier = new Phaser.Signal();
1429114291

1429214292
/**
14293-
* @property {boolean} forceSingleUpdate - Use a variable-step game loop (true) or a fixed-step game loop (false).
14293+
* @property {boolean} forceSingleUpdate - Use a variable-step game loop (true) or a fixed-step game loop (false). When false, {@link Phaser.Time#desiredFps} determines the delta size. A fixed-step loop gives more consistent results in physics calculations.
1429414294
* @default
1429514295
* @see Phaser.Time#desiredFps
1429614296
*/
@@ -15772,8 +15772,8 @@ Phaser.Input.prototype = {
1577215772

1577315773
this.activePointer = this.mousePointer;
1577415774

15775-
this.hitCanvas = Phaser.CanvasPool.create(this, 1, 1);
15776-
this.hitContext = this.hitCanvas.getContext('2d');
15775+
this.hitCanvas = Phaser.Canvas.create(undefined, 1, 1, undefined, true);
15776+
this.hitContext = this.hitCanvas.getContext('2d', { willReadFrequently: true });
1577715777

1577815778
if (this.game.device.mspointer && (config.mspointer !== false))
1577915779
{
@@ -15841,7 +15841,7 @@ Phaser.Input.prototype = {
1584115841

1584215842
this.moveCallbacks = [];
1584315843

15844-
Phaser.CanvasPool.remove(this);
15844+
Phaser.Canvas.dispose(this.hitCanvas);
1584515845

1584615846
this.game.canvas.removeEventListener('click', this._onClickTrampoline);
1584715847
},
@@ -42049,8 +42049,8 @@ Phaser.Device._initialize = function ()
4204942049
*/
4205042050
function _checkCanvasFeatures ()
4205142051
{
42052-
var canvas = Phaser.CanvasPool.create(this, 6, 1);
42053-
var context = canvas.getContext('2d');
42052+
var canvas = Phaser.Canvas.create(undefined, 6, 1, undefined, true);
42053+
var context = canvas.getContext('2d', { willReadFrequently: true });
4205442054

4205542055
context.fillStyle = 'rgba(10, 20, 30, 0.5)';
4205642056

@@ -42081,7 +42081,7 @@ Phaser.Device._initialize = function ()
4208142081
context.globalCompositeOperation = 'multiply';
4208242082
device.canUseMultiply = (context.globalCompositeOperation === 'multiply');
4208342083

42084-
Phaser.CanvasPool.removeByCanvas(canvas);
42084+
Phaser.Canvas.dispose(canvas);
4208542085

4208642086
PIXI.CanvasTinter.tintMethod = (device.canUseMultiply) ? PIXI.CanvasTinter.tintWithMultiply : PIXI.CanvasTinter.tintWithPerPixel;
4208742087
}
@@ -42770,6 +42770,21 @@ Phaser.Canvas = {
4277042770
return canvas;
4277142771
},
4277242772

42773+
/**
42774+
* Sets `canvas` dimensions to 1.
42775+
*
42776+
* @method Phaser.Canvas.dispose
42777+
* @param {HTMLCanvasElement} canvas - The canvas to be disposed of.
42778+
* @return {HTMLCanvasElement} The canvas.
42779+
*/
42780+
dispose: function (canvas)
42781+
{
42782+
canvas.width = 1;
42783+
canvas.height = 1;
42784+
42785+
return canvas;
42786+
},
42787+
4277342788
/**
4277442789
* Sets the background color behind the canvas. This changes the canvas style property.
4277542790
*
@@ -56223,7 +56238,7 @@ Phaser.Loader.prototype = {
5622356238
file.data.removeEventListener(file.loadEvent, videoLoadEvent, false);
5622456239
file.data.onerror = null;
5622556240
file.data.canplay = true;
56226-
_this.game.load.fileComplete(file);
56241+
_this.fileComplete(file);
5622756242
};
5622856243

5622956244
file.data.onerror = function ()
@@ -59285,11 +59300,6 @@ Phaser.SoundManager.prototype = {
5928559300
this.setTouchLock();
5928659301
}
5928759302
}
59288-
59289-
if (this.usingWebAudio && device.chrome && device.chromeVersion <= 65)
59290-
{
59291-
console.log('A "GainNode.gain.value setter smoothing is deprecated" notice in Chrome is normal. <https://github.com/photonstorm/phaser-ce/issues/385>');
59292-
}
5929359303
},
5929459304

5929559305
/**
@@ -59911,8 +59921,6 @@ Object.defineProperty(Phaser.SoundManager.prototype, 'mute', {
5991159921

5991259922
set: function (value)
5991359923
{
59914-
value = value || false;
59915-
5991659924
if (value)
5991759925
{
5991859926
if (this._muted)
@@ -67795,6 +67803,8 @@ Phaser.Physics.prototype.constructor = Phaser.Physics;
6779567803
/**
6779667804
* The Arcade Physics world. Contains Arcade Physics related collision, overlap and motion methods.
6779767805
*
67806+
* Set {@link Phaser.Game#forceSingleUpdate} to `false` for better consistency.
67807+
*
6779867808
* @class Phaser.Physics.Arcade
6779967809
* @constructor
6780067810
* @param {Phaser.Game} game - reference to the current game instance.
@@ -68055,22 +68065,24 @@ Phaser.Physics.Arcade.prototype = {
6805568065
{
6805668066
if (max === undefined) { max = 10000; }
6805768067

68068+
var deltaSec = 0.001 * this.game.time.delta;
68069+
6805868070
if (axis === 1 && body.allowGravity)
6805968071
{
68060-
velocity += (this.gravity.x + body.gravity.x) * 0.001 * this.game.time.delta;
68072+
velocity += (this.gravity.x + body.gravity.x) * deltaSec;
6806168073
}
6806268074
else if (axis === 2 && body.allowGravity)
6806368075
{
68064-
velocity += (this.gravity.y + body.gravity.y) * 0.001 * this.game.time.delta;
68076+
velocity += (this.gravity.y + body.gravity.y) * deltaSec;
6806568077
}
6806668078

6806768079
if (acceleration)
6806868080
{
68069-
velocity += acceleration * 0.001 * this.game.time.delta;
68081+
velocity += acceleration * deltaSec;
6807068082
}
6807168083
else if (drag && body.allowDrag)
6807268084
{
68073-
drag *= 0.001 * this.game.time.delta;
68085+
drag *= deltaSec;
6807468086

6807568087
if (velocity - drag > 0)
6807668088
{

build/custom/phaser-creature.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/custom/phaser-creature.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)