Skip to content

Commit d6a6e92

Browse files
authored
Merge pull request #683 from photonstorm/release/v2.16.2
Phaser CE Version 2.16.2
2 parents ccbe5d7 + 3d05dee commit d6a6e92

File tree

221 files changed

+8095
-7830
lines changed

Some content is hidden

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

221 files changed

+8095
-7830
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.16.2 - 8 March 2021
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.16.1](https://github.com/photonstorm/phaser-ce/releases/tag/v2.16.1).
9+
The [current Phaser CE release is 2.16.2](https://github.com/photonstorm/phaser-ce/releases/tag/v2.16.2).
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://photonstorm.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/[email protected].1/build/phaser.js"></script>
85+
<script src="https://cdn.jsdelivr.net/npm/[email protected].2/build/phaser.js"></script>
8686
```
8787

8888
or the minified version:
8989

9090
```html
91-
<script src="https://cdn.jsdelivr.net/npm/[email protected].1"></script>
91+
<script src="https://cdn.jsdelivr.net/npm/[email protected].2"></script>
9292
```
9393

94-
[Custom builds](https://cdn.jsdelivr.net/npm/[email protected].1/build/custom/) are available too, e.g.,
94+
[Custom builds](https://cdn.jsdelivr.net/npm/[email protected].2/build/custom/) are available too, e.g.,
9595

9696
```html
97-
<script src="https://cdn.jsdelivr.net/npm/[email protected].1/build/custom/phaser-arcade-physics.js"></script>
97+
<script src="https://cdn.jsdelivr.net/npm/[email protected].2/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.16.1/phaser.js
286-
[get-minjs]: https://github.com/photonstorm/phaser-ce/releases/download/v2.16.1/phaser.min.js
287-
[get-zip]: https://github.com/photonstorm/phaser-ce/archive/v2.16.1.zip
288-
[get-tgz]: https://github.com/photonstorm/phaser-ce/archive/v2.16.1.tar.gz
285+
[get-js]: https://github.com/photonstorm/phaser-ce/releases/download/v2.16.2/phaser.js
286+
[get-minjs]: https://github.com/photonstorm/phaser-ce/releases/download/v2.16.2/phaser.min.js
287+
[get-zip]: https://github.com/photonstorm/phaser-ce/archive/v2.16.2.zip
288+
[get-tgz]: https://github.com/photonstorm/phaser-ce/archive/v2.16.2.tar.gz
289289
[clone-http]: https://github.com/photonstorm/phaser.git
290290
[clone-ssh]: ssh://[email protected]: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: 59 additions & 23 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.16.1 "2020-10-21" - Built: Wed Oct 21 2020 14:49:45
10+
* v2.16.2 "2021-03-08" - Built: Mon Mar 08 2021 12:51:42
1111
*
1212
* By Richard Davey http://www.photonstorm.com @photonstorm and Phaser CE contributors
1313
*
@@ -7763,7 +7763,7 @@ var Phaser = Phaser || { // jshint ignore:line
77637763
* @constant Phaser.VERSION
77647764
* @type {string}
77657765
*/
7766-
VERSION: '2.16.1',
7766+
VERSION: '2.16.2',
77677767

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

19831-
if (!checkExists || (checkExists && child.exists))
19831+
if (!checkExists || child.exists)
1983219832
{
1983319833
if (predicate(child, index, this.children))
1983419834
{
@@ -58979,8 +58979,7 @@ Phaser.AnimationParser = {
5897958979

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

5898558984
return null;
5898658985
}
@@ -58990,15 +58989,14 @@ Phaser.AnimationParser = {
5899058989

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

5899558994
return null;
5899658995
}
5899758996

5899858997
if (width < frameWidth || height < frameHeight)
5899958998
{
59000-
console.warn('Phaser.AnimationParser.spriteSheet: \'%s\' width (%s) or height (%s) is less than the given frameWidth (%s) or frameHeight (%s)',
59001-
key, width, height, frameWidth, frameHeight);
58999+
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);
5900259000

5900359001
return null;
5900459002
}
@@ -59013,8 +59011,7 @@ Phaser.AnimationParser = {
5901359011

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

5901959016
return null;
5902059017
}
@@ -59027,19 +59024,23 @@ Phaser.AnimationParser = {
5902759024

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

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

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

5904459045
return null;
5904559046
}
@@ -59061,14 +59062,14 @@ Phaser.AnimationParser = {
5906159062

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

5906659067
return null;
5906759068
}
5906859069

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

5907359074
return null;
5907459075
}
@@ -67309,6 +67310,16 @@ Phaser.SoundManager.prototype = {
6730967310
this.onTouchUnlock.dispatch();
6731067311
},
6731167312

67313+
/**
67314+
* Is the Web Audio context suspended?
67315+
*
67316+
* @return {boolean}
67317+
*/
67318+
webAudioIsSuspended: function ()
67319+
{
67320+
return (this.usingWebAudio && this.context.state === 'suspended');
67321+
},
67322+
6731267323
/**
6731367324
* Try to resume the Web Audio context, if using Web Audio.
6731467325
*
@@ -67329,7 +67340,7 @@ Phaser.SoundManager.prototype = {
6732967340
*/
6733067341
resumeWebAudioIfSuspended: function ()
6733167342
{
67332-
if (this.usingWebAudio && this.context.state === 'suspended')
67343+
if (this.webAudioIsSuspended())
6733367344
{
6733467345
return this.context.resume();
6733567346
}
@@ -67552,9 +67563,14 @@ Phaser.SoundManager.prototype = {
6755267563
return;
6755367564
}
6755467565

67555-
for (var i = 0; i < this._sounds.length; i++)
67566+
// When suspended the context does not advance at all.
67567+
67568+
if (!this.webAudioIsSuspended())
6755667569
{
67557-
this._sounds[i].update();
67570+
for (var i = 0; i < this._sounds.length; i++)
67571+
{
67572+
this._sounds[i].update();
67573+
}
6755867574
}
6755967575

6756067576
if (this._watching)
@@ -80652,7 +80668,7 @@ Phaser.Tilemap.prototype = {
8065280668
key = tileset;
8065380669
}
8065480670

80655-
if (key instanceof Phaser.BitmapData)
80671+
if (Phaser.BitmapData && key instanceof Phaser.BitmapData)
8065680672
{
8065780673
img = key.canvas;
8065880674
}
@@ -80823,9 +80839,29 @@ Phaser.Tilemap.prototype = {
8082380839

8082480840
group.add(sprite);
8082580841

80826-
for (var property in obj.properties)
80842+
// Set properties directly on the sprite
80843+
80844+
var properties = obj.properties;
80845+
80846+
if (Array.isArray(properties))
8082780847
{
80828-
group.set(sprite, property, obj.properties[property], false, false, 0, true);
80848+
// New property format <https://doc.mapeditor.org/en/stable/reference/json-map-format/#property>
80849+
80850+
for (var j = 0; j < properties.length; j++)
80851+
{
80852+
var propData = properties[j];
80853+
80854+
group.set(sprite, propData.name, propData.value, false, false, 0, true);
80855+
}
80856+
}
80857+
else
80858+
{
80859+
// Old property format
80860+
80861+
for (var propertyName in properties)
80862+
{
80863+
group.set(sprite, propertyName, properties[propertyName], false, false, 0, true);
80864+
}
8082980865
}
8083080866
}
8083180867
}

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.

0 commit comments

Comments
 (0)