Skip to content

Commit 3d05dee

Browse files
committed
Build Phaser CE v2.16.2
1 parent 58059c7 commit 3d05dee

File tree

217 files changed

+8082
-7817
lines changed

Some content is hidden

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

217 files changed

+8082
-7817
lines changed

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.

build/custom/phaser-creature.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:50:03
10+
* v2.16.2 "2021-03-08" - Built: Mon Mar 08 2021 12:51:59
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.16.1',
43+
VERSION: '2.16.2',
4444

4545
/**
4646
* An array of Phaser game instances.
@@ -12105,7 +12105,7 @@ Phaser.Group.prototype.filter = function (predicate, checkExists)
1210512105
{
1210612106
var child = this.children[index];
1210712107

12108-
if (!checkExists || (checkExists && child.exists))
12108+
if (!checkExists || child.exists)
1210912109
{
1211012110
if (predicate(child, index, this.children))
1211112111
{
@@ -51256,8 +51256,7 @@ Phaser.AnimationParser = {
5125651256

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

5126251261
return null;
5126351262
}
@@ -51267,15 +51266,14 @@ Phaser.AnimationParser = {
5126751266

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

5127251271
return null;
5127351272
}
5127451273

5127551274
if (width < frameWidth || height < frameHeight)
5127651275
{
51277-
console.warn('Phaser.AnimationParser.spriteSheet: \'%s\' width (%s) or height (%s) is less than the given frameWidth (%s) or frameHeight (%s)',
51278-
key, width, height, frameWidth, frameHeight);
51276+
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);
5127951277

5128051278
return null;
5128151279
}
@@ -51290,8 +51288,7 @@ Phaser.AnimationParser = {
5129051288

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

5129651293
return null;
5129751294
}
@@ -51304,19 +51301,23 @@ Phaser.AnimationParser = {
5130451301

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

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

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

5132151322
return null;
5132251323
}
@@ -51338,14 +51339,14 @@ Phaser.AnimationParser = {
5133851339

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

5134351344
return null;
5134451345
}
5134551346

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

5135051351
return null;
5135151352
}
@@ -59586,6 +59587,16 @@ Phaser.SoundManager.prototype = {
5958659587
this.onTouchUnlock.dispatch();
5958759588
},
5958859589

59590+
/**
59591+
* Is the Web Audio context suspended?
59592+
*
59593+
* @return {boolean}
59594+
*/
59595+
webAudioIsSuspended: function ()
59596+
{
59597+
return (this.usingWebAudio && this.context.state === 'suspended');
59598+
},
59599+
5958959600
/**
5959059601
* Try to resume the Web Audio context, if using Web Audio.
5959159602
*
@@ -59606,7 +59617,7 @@ Phaser.SoundManager.prototype = {
5960659617
*/
5960759618
resumeWebAudioIfSuspended: function ()
5960859619
{
59609-
if (this.usingWebAudio && this.context.state === 'suspended')
59620+
if (this.webAudioIsSuspended())
5961059621
{
5961159622
return this.context.resume();
5961259623
}
@@ -59829,9 +59840,14 @@ Phaser.SoundManager.prototype = {
5982959840
return;
5983059841
}
5983159842

59832-
for (var i = 0; i < this._sounds.length; i++)
59843+
// When suspended the context does not advance at all.
59844+
59845+
if (!this.webAudioIsSuspended())
5983359846
{
59834-
this._sounds[i].update();
59847+
for (var i = 0; i < this._sounds.length; i++)
59848+
{
59849+
this._sounds[i].update();
59850+
}
5983559851
}
5983659852

5983759853
if (this._watching)
@@ -78611,7 +78627,7 @@ Phaser.Tilemap.prototype = {
7861178627
key = tileset;
7861278628
}
7861378629

78614-
if (key instanceof Phaser.BitmapData)
78630+
if (Phaser.BitmapData && key instanceof Phaser.BitmapData)
7861578631
{
7861678632
img = key.canvas;
7861778633
}
@@ -78782,9 +78798,29 @@ Phaser.Tilemap.prototype = {
7878278798

7878378799
group.add(sprite);
7878478800

78785-
for (var property in obj.properties)
78801+
// Set properties directly on the sprite
78802+
78803+
var properties = obj.properties;
78804+
78805+
if (Array.isArray(properties))
7878678806
{
78787-
group.set(sprite, property, obj.properties[property], false, false, 0, true);
78807+
// New property format <https://doc.mapeditor.org/en/stable/reference/json-map-format/#property>
78808+
78809+
for (var j = 0; j < properties.length; j++)
78810+
{
78811+
var propData = properties[j];
78812+
78813+
group.set(sprite, propData.name, propData.value, false, false, 0, true);
78814+
}
78815+
}
78816+
else
78817+
{
78818+
// Old property format
78819+
78820+
for (var propertyName in properties)
78821+
{
78822+
group.set(sprite, propertyName, properties[propertyName], false, false, 0, true);
78823+
}
7878878824
}
7878978825
}
7879078826
}

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)