Skip to content

Commit a2c7515

Browse files
Phaser: add 2.6.2 source.
1 parent 3758d43 commit a2c7515

Some content is hidden

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

58 files changed

+5084
-1630
lines changed

source/phasereditor/phasereditor.inspect.core.resources/phaser-version/phaser-master/build/phaser.js

Lines changed: 1066 additions & 792 deletions
Large diffs are not rendered by default.

source/phasereditor/phasereditor.inspect.core.resources/phaser-version/phaser-master/src/Phaser.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* global Phaser:true */
21
/**
32
* @author Richard Davey <rich@photonstorm.com>
43
* @copyright 2016 Photon Storm Ltd.
@@ -8,14 +7,14 @@
87
/**
98
* @namespace Phaser
109
*/
11-
var Phaser = Phaser || {
10+
var Phaser = Phaser || { // jshint ignore:line
1211

1312
/**
1413
* The Phaser version number.
1514
* @constant
1615
* @type {string}
1716
*/
18-
VERSION: '2.6.1',
17+
VERSION: '2.6.2',
1918

2019
/**
2120
* An array of Phaser game instances.

source/phasereditor/phasereditor.inspect.core.resources/phaser-version/phaser-master/src/animation/Animation.js

Lines changed: 27 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -244,29 +244,33 @@ Phaser.Animation.prototype = {
244244
},
245245

246246
/**
247-
* Reverses the animation direction
248-
*
249-
* @method Phaser.Animation#reverse
250-
* @return {Phaser.Animation} The animation instance.
251-
* */
247+
* Reverses the animation direction.
248+
*
249+
* @method Phaser.Animation#reverse
250+
* @return {Phaser.Animation} The animation instance.
251+
*/
252252
reverse: function () {
253+
253254
this.reversed = !this.reversed;
254255

255256
return this;
257+
256258
},
257259

258260
/**
259-
* Reverses the animation direction for the current/next animation only
260-
* Once the onComplete event is called this method will be called again and revert
261-
* the reversed state.
262-
*
263-
* @method Phaser.Animation#reverseOnce
264-
* @return {Phaser.Animation} The animation instance.
265-
* */
261+
* Reverses the animation direction for the current/next animation only
262+
* Once the onComplete event is called this method will be called again and revert
263+
* the reversed state.
264+
*
265+
* @method Phaser.Animation#reverseOnce
266+
* @return {Phaser.Animation} The animation instance.
267+
*/
266268
reverseOnce: function () {
267-
this.onComplete.addOnce(this.reverse.bind(this));
269+
270+
this.onComplete.addOnce(this.reverse, this);
268271

269272
return this.reverse();
273+
270274
},
271275

272276
/**
@@ -417,9 +421,12 @@ Phaser.Animation.prototype = {
417421
// And what's left now?
418422
this._timeNextFrame = this.game.time.time + (this.delay - this._frameDiff);
419423

420-
if (this.isReversed){
424+
if (this.isReversed)
425+
{
421426
this._frameIndex -= this._frameSkip;
422-
}else{
427+
}
428+
else
429+
{
423430
this._frameIndex += this._frameSkip;
424431
}
425432

@@ -430,7 +437,8 @@ Phaser.Animation.prototype = {
430437
// Update current state before event callback
431438
this._frameIndex = Math.abs(this._frameIndex) % this._frames.length;
432439

433-
if (this.isReversed){
440+
if (this.isReversed)
441+
{
434442
this._frameIndex = this._frames.length - 1 - this._frameIndex;
435443
}
436444

@@ -768,19 +776,19 @@ Object.defineProperty(Phaser.Animation.prototype, 'frame', {
768776

769777
/**
770778
* @name Phaser.Animation#speed
771-
* @property {number} speed - Gets or sets the current speed of the animation in frames per second. Changing this in a playing animation will take effect from the next frame. Minimum value is 1.
779+
* @property {number} speed - Gets or sets the current speed of the animation in frames per second. Changing this in a playing animation will take effect from the next frame. Value must be greater than 0.
772780
*/
773781
Object.defineProperty(Phaser.Animation.prototype, 'speed', {
774782

775783
get: function () {
776784

777-
return Math.round(1000 / this.delay);
785+
return 1000 / this.delay;
778786

779787
},
780788

781789
set: function (value) {
782790

783-
if (value >= 1)
791+
if (value > 0)
784792
{
785793
this.delay = 1000 / value;
786794
}

source/phasereditor/phasereditor.inspect.core.resources/phaser-version/phaser-master/src/animation/AnimationManager.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -207,9 +207,6 @@ Phaser.AnimationManager.prototype = {
207207

208208
this.currentAnim = this._anims[name];
209209

210-
// This shouldn't be set until the Animation is played, surely?
211-
// this.currentFrame = this.currentAnim.currentFrame;
212-
213210
if (this.sprite.tilingTexture)
214211
{
215212
this.sprite.refreshTexture = true;

source/phasereditor/phasereditor.inspect.core.resources/phaser-version/phaser-master/src/animation/AnimationParser.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,15 +160,16 @@ Phaser.AnimationParser = {
160160
signature.forEach( function(key) {
161161
if (!json[key])
162162
{
163-
console.warn("Phaser.AnimationParser.JSONDataPyxel: Invalid Pyxel Tilemap JSON given, missing '" + key + "' key.");
163+
console.warn('Phaser.AnimationParser.JSONDataPyxel: Invalid Pyxel Tilemap JSON given, missing "' + key + '" key.');
164164
console.log(json);
165165
return;
166166
}
167167
});
168168

169169
// For this purpose, I only care about parsing tilemaps with a single layer.
170-
if(json['layers'].length != 1) {
171-
console.warn("Phaser.AnimationParser.JSONDataPyxel: Too many layers, this parser only supports flat Tilemaps.");
170+
if (json['layers'].length !== 1)
171+
{
172+
console.warn('Phaser.AnimationParser.JSONDataPyxel: Too many layers, this parser only supports flat Tilemaps.');
172173
console.log(json);
173174
return;
174175
}

source/phasereditor/phasereditor.inspect.core.resources/phaser-version/phaser-master/src/core/Game.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -629,7 +629,7 @@ Phaser.Game.prototype = {
629629
r = 'WebGL';
630630
c++;
631631
}
632-
else if (this.renderType == Phaser.HEADLESS)
632+
else if (this.renderType === Phaser.HEADLESS)
633633
{
634634
r = 'Headless';
635635
}

0 commit comments

Comments
 (0)