Skip to content

Commit

Permalink
Merge pull request #683 from photonstorm/release/v2.16.2
Browse files Browse the repository at this point in the history
Phaser CE Version 2.16.2
  • Loading branch information
photonstorm committed Mar 8, 2021
2 parents ccbe5d7 + 3d05dee commit d6a6e92
Show file tree
Hide file tree
Showing 221 changed files with 8,095 additions and 7,830 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.16.2 - 8 March 2021

### 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.16.1](https://github.com/photonstorm/phaser-ce/releases/tag/v2.16.1).
The [current Phaser CE release is 2.16.2](https://github.com/photonstorm/phaser-ce/releases/tag/v2.16.2).

- **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://photonstorm.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.16.1/build/phaser.js"></script>
<script src="https://cdn.jsdelivr.net/npm/phaser-ce@2.16.2/build/phaser.js"></script>
```

or the minified version:

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

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

```html
<script src="https://cdn.jsdelivr.net/npm/phaser-ce@2.16.1/build/custom/phaser-arcade-physics.js"></script>
<script src="https://cdn.jsdelivr.net/npm/phaser-ce@2.16.2/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.16.1/phaser.js
[get-minjs]: https://github.com/photonstorm/phaser-ce/releases/download/v2.16.1/phaser.min.js
[get-zip]: https://github.com/photonstorm/phaser-ce/archive/v2.16.1.zip
[get-tgz]: https://github.com/photonstorm/phaser-ce/archive/v2.16.1.tar.gz
[get-js]: https://github.com/photonstorm/phaser-ce/releases/download/v2.16.2/phaser.js
[get-minjs]: https://github.com/photonstorm/phaser-ce/releases/download/v2.16.2/phaser.min.js
[get-zip]: https://github.com/photonstorm/phaser-ce/archive/v2.16.2.zip
[get-tgz]: https://github.com/photonstorm/phaser-ce/archive/v2.16.2.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.

82 changes: 59 additions & 23 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.16.1 "2020-10-21" - Built: Wed Oct 21 2020 14:49:45
* v2.16.2 "2021-03-08" - Built: Mon Mar 08 2021 12:51:42
*
* By Richard Davey http://www.photonstorm.com @photonstorm and Phaser CE contributors
*
Expand Down Expand Up @@ -7763,7 +7763,7 @@ var Phaser = Phaser || { // jshint ignore:line
* @constant Phaser.VERSION
* @type {string}
*/
VERSION: '2.16.1',
VERSION: '2.16.2',

/**
* An array of Phaser game instances.
Expand Down Expand Up @@ -19828,7 +19828,7 @@ Phaser.Group.prototype.filter = function (predicate, checkExists)
{
var child = this.children[index];

if (!checkExists || (checkExists && child.exists))
if (!checkExists || child.exists)
{
if (predicate(child, index, this.children))
{
Expand Down Expand Up @@ -58979,8 +58979,7 @@ Phaser.AnimationParser = {

if (frameWidth <= 0 || frameHeight <= 0)
{
console.warn('Phaser.AnimationParser.spriteSheet: \'%s\' frameWidth (%s) or frameHeight (%s) must be positive',
key, frameWidth, frameHeight);
console.error('Spritesheet "%s": frameWidth (%s) and frameHeight (%s) values must be positive', key, frameWidth, frameHeight);

return null;
}
Expand All @@ -58990,15 +58989,14 @@ Phaser.AnimationParser = {

if (width === 0 || height === 0)
{
console.warn('Phaser.AnimationParser.spriteSheet: \'%s\' width (%s) or height (%s) is zero', key, width, height);
console.error('Spritesheet "%s": Texture width (%s) or height (%s) is zero', key, width, height);

return null;
}

if (width < frameWidth || height < frameHeight)
{
console.warn('Phaser.AnimationParser.spriteSheet: \'%s\' width (%s) or height (%s) is less than the given frameWidth (%s) or frameHeight (%s)',
key, width, height, frameWidth, frameHeight);
console.error('Spritesheet "%s": Texture width (%s) or height (%s) is less than the given frameWidth (%s) or frameHeight (%s)', key, width, height, frameWidth, frameHeight);

return null;
}
Expand All @@ -59013,8 +59011,7 @@ Phaser.AnimationParser = {

if (skipFrames > total || skipFrames < -total)
{
console.warn('Phaser.AnimationParser.spriteSheet: \'%s\' skipFrames = %s is larger than the frame total %s',
key, skipFrames, total);
console.error('Spritesheet "%s": skipFrames=%s is larger than the frame total %s', key, skipFrames, total);

return null;
}
Expand All @@ -59027,19 +59024,23 @@ Phaser.AnimationParser = {

if (row < 1)
{
console.warn('Phaser.AnimationParser.spriteSheet: image \'%s\' has width %d, but it should be at least %d (frameWidth=%s, margin=%s, spacing=%s)',
key, width, frameWidth + margin + spacing, frameWidth, margin, spacing);
console.warn(
'Spritesheet "%s": Texture has width %d, but it should be at least %d (frameWidth=%s, margin=%s, spacing=%s)',
key, width, frameWidth + margin + spacing, frameWidth, margin, spacing
);
}

if (column < 1)
{
console.warn('Phaser.AnimationParser.spriteSheet: image \'%s\' has height %d, but it should be at least %d (frameHeight=%s, margin=%s, spacing=%s)',
key, height, frameHeight + margin + spacing, frameHeight, margin, spacing);
console.warn(
'Spritesheet "%s": Texture has height %d, but it should be at least %d (frameHeight=%s, margin=%s, spacing=%s)',
key, height, frameHeight + margin + spacing, frameHeight, margin, spacing
);
}

if (totalAvailable === 0)
{
console.warn('Phaser.AnimationParser.spriteSheet: \'%s\' zero frames were produced', key);
console.error('Spritesheet "%s": zero frames were produced', key);

return null;
}
Expand All @@ -59061,14 +59062,14 @@ Phaser.AnimationParser = {

if (firstFrame < 0)
{
console.warn('First frame index %s is outside of range [0, %d]', firstFrame, lastAvailable);
console.error('Spritesheet "%s": There is no frame at index %s', key, firstFrame);

return null;
}

if (lastFrame > lastAvailable)
{
console.warn('Last frame index %s is outside of range [0, %d]', lastFrame, lastAvailable);
console.warn('Spritesheet "%s": There is no frame at index %s. Last frame found is index %s', key, lastFrame, lastAvailable);

return null;
}
Expand Down Expand Up @@ -67309,6 +67310,16 @@ Phaser.SoundManager.prototype = {
this.onTouchUnlock.dispatch();
},

/**
* Is the Web Audio context suspended?
*
* @return {boolean}
*/
webAudioIsSuspended: function ()
{
return (this.usingWebAudio && this.context.state === 'suspended');
},

/**
* Try to resume the Web Audio context, if using Web Audio.
*
Expand All @@ -67329,7 +67340,7 @@ Phaser.SoundManager.prototype = {
*/
resumeWebAudioIfSuspended: function ()
{
if (this.usingWebAudio && this.context.state === 'suspended')
if (this.webAudioIsSuspended())
{
return this.context.resume();
}
Expand Down Expand Up @@ -67552,9 +67563,14 @@ Phaser.SoundManager.prototype = {
return;
}

for (var i = 0; i < this._sounds.length; i++)
// When suspended the context does not advance at all.

if (!this.webAudioIsSuspended())
{
this._sounds[i].update();
for (var i = 0; i < this._sounds.length; i++)
{
this._sounds[i].update();
}
}

if (this._watching)
Expand Down Expand Up @@ -80652,7 +80668,7 @@ Phaser.Tilemap.prototype = {
key = tileset;
}

if (key instanceof Phaser.BitmapData)
if (Phaser.BitmapData && key instanceof Phaser.BitmapData)
{
img = key.canvas;
}
Expand Down Expand Up @@ -80823,9 +80839,29 @@ Phaser.Tilemap.prototype = {

group.add(sprite);

for (var property in obj.properties)
// Set properties directly on the sprite

var properties = obj.properties;

if (Array.isArray(properties))
{
group.set(sprite, property, obj.properties[property], false, false, 0, true);
// New property format <https://doc.mapeditor.org/en/stable/reference/json-map-format/#property>

for (var j = 0; j < properties.length; j++)
{
var propData = properties[j];

group.set(sprite, propData.name, propData.value, false, false, 0, true);
}
}
else
{
// Old property format

for (var propertyName in properties)
{
group.set(sprite, propertyName, properties[propertyName], false, false, 0, true);
}
}
}
}
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.

0 comments on commit d6a6e92

Please sign in to comment.