Skip to content

Commit

Permalink
Merge pull request #744 from phaserjs/release/v2.20.1
Browse files Browse the repository at this point in the history
Phaser CE Version 2.20.1
  • Loading branch information
photonstorm authored Oct 8, 2024
2 parents 5fe0ba5 + ab70661 commit f7983e4
Show file tree
Hide file tree
Showing 224 changed files with 11,431 additions and 11,136 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Change Log

## Unreleased
## Version 2.20.1 - 5 October 2024

### Updates

Expand Down
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Phaser CE is a fast, free, and fun open source HTML5 game framework. It uses a c

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.

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

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

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

or the minified version:

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

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

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

<a name="getting-started"></a>
Expand Down Expand Up @@ -282,10 +282,10 @@ All rights reserved.

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

[get-js]: https://github.com/photonstorm/phaser-ce/releases/download/v2.20.0/phaser.js
[get-minjs]: https://github.com/photonstorm/phaser-ce/releases/download/v2.20.0/phaser.min.js
[get-zip]: https://github.com/photonstorm/phaser-ce/archive/v2.20.0.zip
[get-tgz]: https://github.com/photonstorm/phaser-ce/archive/v2.20.0.tar.gz
[get-js]: https://github.com/photonstorm/phaser-ce/releases/download/v2.20.1/phaser.js
[get-minjs]: https://github.com/photonstorm/phaser-ce/releases/download/v2.20.1/phaser.min.js
[get-zip]: https://github.com/photonstorm/phaser-ce/archive/v2.20.1.zip
[get-tgz]: https://github.com/photonstorm/phaser-ce/archive/v2.20.1.tar.gz
[clone-http]: https://github.com/photonstorm/phaser.git
[clone-ssh]: ssh://git@github.com:photonstorm/phaser.git
[clone-svn]: https://github.com/photonstorm/phaser
Expand Down
2 changes: 1 addition & 1 deletion build/custom/creature.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/custom/p2.min.js

Large diffs are not rendered by default.

54 changes: 33 additions & 21 deletions build/custom/phaser-arcade-physics.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*
* Phaser CE - https://github.com/photonstorm/phaser-ce
*
* v2.20.0 "2022-12-10" - Built: Sat Dec 10 2022 07:57:43
* v2.20.1 "2024-10-05" - Built: Sat Oct 05 2024 11:25:47
*
* By Richard Davey http://www.photonstorm.com @photonstorm and Phaser CE contributors
*
Expand Down Expand Up @@ -7774,7 +7774,7 @@ var Phaser = Phaser || { // jshint ignore:line
* @constant Phaser.VERSION
* @type {string}
*/
VERSION: '2.20.0',
VERSION: '2.20.1',

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

/**
* @property {boolean} forceSingleUpdate - Use a variable-step game loop (true) or a fixed-step game loop (false).
* @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.
* @default
* @see Phaser.Time#desiredFps
*/
Expand Down Expand Up @@ -23506,8 +23506,8 @@ Phaser.Input.prototype = {

this.activePointer = this.mousePointer;

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

if (this.game.device.mspointer && (config.mspointer !== false))
{
Expand Down Expand Up @@ -23575,7 +23575,7 @@ Phaser.Input.prototype = {

this.moveCallbacks = [];

Phaser.CanvasPool.remove(this);
Phaser.Canvas.dispose(this.hitCanvas);

this.game.canvas.removeEventListener('click', this._onClickTrampoline);
},
Expand Down Expand Up @@ -49783,8 +49783,8 @@ Phaser.Device._initialize = function ()
*/
function _checkCanvasFeatures ()
{
var canvas = Phaser.CanvasPool.create(this, 6, 1);
var context = canvas.getContext('2d');
var canvas = Phaser.Canvas.create(undefined, 6, 1, undefined, true);
var context = canvas.getContext('2d', { willReadFrequently: true });

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

Expand Down Expand Up @@ -49815,7 +49815,7 @@ Phaser.Device._initialize = function ()
context.globalCompositeOperation = 'multiply';
device.canUseMultiply = (context.globalCompositeOperation === 'multiply');

Phaser.CanvasPool.removeByCanvas(canvas);
Phaser.Canvas.dispose(canvas);

PIXI.CanvasTinter.tintMethod = (device.canUseMultiply) ? PIXI.CanvasTinter.tintWithMultiply : PIXI.CanvasTinter.tintWithPerPixel;
}
Expand Down Expand Up @@ -50504,6 +50504,21 @@ Phaser.Canvas = {
return canvas;
},

/**
* Sets `canvas` dimensions to 1.
*
* @method Phaser.Canvas.dispose
* @param {HTMLCanvasElement} canvas - The canvas to be disposed of.
* @return {HTMLCanvasElement} The canvas.
*/
dispose: function (canvas)
{
canvas.width = 1;
canvas.height = 1;

return canvas;
},

/**
* Sets the background color behind the canvas. This changes the canvas style property.
*
Expand Down Expand Up @@ -63957,7 +63972,7 @@ Phaser.Loader.prototype = {
file.data.removeEventListener(file.loadEvent, videoLoadEvent, false);
file.data.onerror = null;
file.data.canplay = true;
_this.game.load.fileComplete(file);
_this.fileComplete(file);
};

file.data.onerror = function ()
Expand Down Expand Up @@ -67019,11 +67034,6 @@ Phaser.SoundManager.prototype = {
this.setTouchLock();
}
}

if (this.usingWebAudio && device.chrome && device.chromeVersion <= 65)
{
console.log('A "GainNode.gain.value setter smoothing is deprecated" notice in Chrome is normal. <https://github.com/photonstorm/phaser-ce/issues/385>');
}
},

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

set: function (value)
{
value = value || false;

if (value)
{
if (this._muted)
Expand Down Expand Up @@ -75529,6 +75537,8 @@ Phaser.Physics.prototype.constructor = Phaser.Physics;
/**
* The Arcade Physics world. Contains Arcade Physics related collision, overlap and motion methods.
*
* Set {@link Phaser.Game#forceSingleUpdate} to `false` for better consistency.
*
* @class Phaser.Physics.Arcade
* @constructor
* @param {Phaser.Game} game - reference to the current game instance.
Expand Down Expand Up @@ -75789,22 +75799,24 @@ Phaser.Physics.Arcade.prototype = {
{
if (max === undefined) { max = 10000; }

var deltaSec = 0.001 * this.game.time.delta;

if (axis === 1 && body.allowGravity)
{
velocity += (this.gravity.x + body.gravity.x) * 0.001 * this.game.time.delta;
velocity += (this.gravity.x + body.gravity.x) * deltaSec;
}
else if (axis === 2 && body.allowGravity)
{
velocity += (this.gravity.y + body.gravity.y) * 0.001 * this.game.time.delta;
velocity += (this.gravity.y + body.gravity.y) * deltaSec;
}

if (acceleration)
{
velocity += acceleration * 0.001 * this.game.time.delta;
velocity += acceleration * deltaSec;
}
else if (drag && body.allowDrag)
{
drag *= 0.001 * this.game.time.delta;
drag *= deltaSec;

if (velocity - drag > 0)
{
Expand Down
2 changes: 1 addition & 1 deletion build/custom/phaser-arcade-physics.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions build/custom/phaser-arcade-physics.min.js

Large diffs are not rendered by default.

54 changes: 33 additions & 21 deletions build/custom/phaser-creature.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*
* Phaser CE - https://github.com/photonstorm/phaser-ce
*
* v2.20.0 "2022-12-10" - Built: Sat Dec 10 2022 07:58:01
* v2.20.1 "2024-10-05" - Built: Sat Oct 05 2024 11:26:10
*
* By Richard Davey http://www.photonstorm.com @photonstorm and Phaser CE contributors
*
Expand Down Expand Up @@ -40,7 +40,7 @@ var Phaser = Phaser || { // jshint ignore:line
* @constant Phaser.VERSION
* @type {string}
*/
VERSION: '2.20.0',
VERSION: '2.20.1',

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

/**
* @property {boolean} forceSingleUpdate - Use a variable-step game loop (true) or a fixed-step game loop (false).
* @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.
* @default
* @see Phaser.Time#desiredFps
*/
Expand Down Expand Up @@ -15772,8 +15772,8 @@ Phaser.Input.prototype = {

this.activePointer = this.mousePointer;

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

if (this.game.device.mspointer && (config.mspointer !== false))
{
Expand Down Expand Up @@ -15841,7 +15841,7 @@ Phaser.Input.prototype = {

this.moveCallbacks = [];

Phaser.CanvasPool.remove(this);
Phaser.Canvas.dispose(this.hitCanvas);

this.game.canvas.removeEventListener('click', this._onClickTrampoline);
},
Expand Down Expand Up @@ -42049,8 +42049,8 @@ Phaser.Device._initialize = function ()
*/
function _checkCanvasFeatures ()
{
var canvas = Phaser.CanvasPool.create(this, 6, 1);
var context = canvas.getContext('2d');
var canvas = Phaser.Canvas.create(undefined, 6, 1, undefined, true);
var context = canvas.getContext('2d', { willReadFrequently: true });

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

Expand Down Expand Up @@ -42081,7 +42081,7 @@ Phaser.Device._initialize = function ()
context.globalCompositeOperation = 'multiply';
device.canUseMultiply = (context.globalCompositeOperation === 'multiply');

Phaser.CanvasPool.removeByCanvas(canvas);
Phaser.Canvas.dispose(canvas);

PIXI.CanvasTinter.tintMethod = (device.canUseMultiply) ? PIXI.CanvasTinter.tintWithMultiply : PIXI.CanvasTinter.tintWithPerPixel;
}
Expand Down Expand Up @@ -42770,6 +42770,21 @@ Phaser.Canvas = {
return canvas;
},

/**
* Sets `canvas` dimensions to 1.
*
* @method Phaser.Canvas.dispose
* @param {HTMLCanvasElement} canvas - The canvas to be disposed of.
* @return {HTMLCanvasElement} The canvas.
*/
dispose: function (canvas)
{
canvas.width = 1;
canvas.height = 1;

return canvas;
},

/**
* Sets the background color behind the canvas. This changes the canvas style property.
*
Expand Down Expand Up @@ -56223,7 +56238,7 @@ Phaser.Loader.prototype = {
file.data.removeEventListener(file.loadEvent, videoLoadEvent, false);
file.data.onerror = null;
file.data.canplay = true;
_this.game.load.fileComplete(file);
_this.fileComplete(file);
};

file.data.onerror = function ()
Expand Down Expand Up @@ -59285,11 +59300,6 @@ Phaser.SoundManager.prototype = {
this.setTouchLock();
}
}

if (this.usingWebAudio && device.chrome && device.chromeVersion <= 65)
{
console.log('A "GainNode.gain.value setter smoothing is deprecated" notice in Chrome is normal. <https://github.com/photonstorm/phaser-ce/issues/385>');
}
},

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

set: function (value)
{
value = value || false;

if (value)
{
if (this._muted)
Expand Down Expand Up @@ -67795,6 +67803,8 @@ Phaser.Physics.prototype.constructor = Phaser.Physics;
/**
* The Arcade Physics world. Contains Arcade Physics related collision, overlap and motion methods.
*
* Set {@link Phaser.Game#forceSingleUpdate} to `false` for better consistency.
*
* @class Phaser.Physics.Arcade
* @constructor
* @param {Phaser.Game} game - reference to the current game instance.
Expand Down Expand Up @@ -68055,22 +68065,24 @@ Phaser.Physics.Arcade.prototype = {
{
if (max === undefined) { max = 10000; }

var deltaSec = 0.001 * this.game.time.delta;

if (axis === 1 && body.allowGravity)
{
velocity += (this.gravity.x + body.gravity.x) * 0.001 * this.game.time.delta;
velocity += (this.gravity.x + body.gravity.x) * deltaSec;
}
else if (axis === 2 && body.allowGravity)
{
velocity += (this.gravity.y + body.gravity.y) * 0.001 * this.game.time.delta;
velocity += (this.gravity.y + body.gravity.y) * deltaSec;
}

if (acceleration)
{
velocity += acceleration * 0.001 * this.game.time.delta;
velocity += acceleration * deltaSec;
}
else if (drag && body.allowDrag)
{
drag *= 0.001 * this.game.time.delta;
drag *= deltaSec;

if (velocity - drag > 0)
{
Expand Down
2 changes: 1 addition & 1 deletion build/custom/phaser-creature.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions build/custom/phaser-creature.min.js

Large diffs are not rendered by default.

Loading

0 comments on commit f7983e4

Please sign in to comment.