11/**
22* Phaser - http://www.phaser.io
33*
4- * v1.0.1 - Built at: Wed, 18 Sep 2013 05:29:56 +0000
4+ * v1.0.5 - Built at: Thu, 19 Sep 2013 03:03:05 +0000
55*
66* @author Richard Davey http://www.photonstorm.com @photonstorm
77*
@@ -34,7 +34,7 @@ var PIXI = PIXI || {};
3434 */
3535var Phaser = Phaser || {
3636
37- VERSION: '1.0.4 ',
37+ VERSION: '1.0.5 ',
3838 GAMES: [],
3939 AUTO: 0,
4040 CANVAS: 1,
@@ -16769,6 +16769,26 @@ Phaser.Math = {
1676916769 }
1677016770 }
1677116771
16772+ },
16773+
16774+ /**
16775+ * Returns an Array containing the numbers from min to max (inclusive)
16776+ *
16777+ * @param min The minimum value the array starts with
16778+ * @param max The maximum value the array contains
16779+ * @return The array of number values
16780+ */
16781+ numberArray: function (min, max) {
16782+
16783+ var result = [];
16784+
16785+ for (var i = min; i <= max; i++)
16786+ {
16787+ result.push(i);
16788+ }
16789+
16790+ return result;
16791+
1677216792 },
1677316793
1677416794 /**
@@ -19282,6 +19302,7 @@ Phaser.TweenManager = function (game) {
1928219302
1928319303 this.game = game;
1928419304 this._tweens = [];
19305+ this._add = [];
1928519306
1928619307 this.game.onPause.add(this.pauseAll, this);
1928719308 this.game.onResume.add(this.resumeAll, this);
@@ -19319,7 +19340,7 @@ Phaser.TweenManager.prototype = {
1931919340 */
1932019341 add: function ( tween ) {
1932119342
19322- this._tweens .push( tween );
19343+ this._add .push( tween );
1932319344
1932419345 },
1932519346
@@ -19346,7 +19367,7 @@ Phaser.TweenManager.prototype = {
1934619367
1934719368 if ( i !== -1 ) {
1934819369
19349- this._tweens.splice( i, 1 ) ;
19370+ this._tweens[i].pendingDelete = true ;
1935019371
1935119372 }
1935219373
@@ -19359,9 +19380,10 @@ Phaser.TweenManager.prototype = {
1935919380 */
1936019381 update: function () {
1936119382
19362- if ( this._tweens.length === 0 ) return false;
19383+ if ( this._tweens.length === 0 && this._add.length === 0 ) return false;
1936319384
19364- var i = 0, numTweens = this._tweens.length;
19385+ var i = 0;
19386+ var numTweens = this._tweens.length;
1936519387
1936619388 while ( i < numTweens ) {
1936719389
@@ -19379,6 +19401,13 @@ Phaser.TweenManager.prototype = {
1937919401
1938019402 }
1938119403
19404+ // If there are any new tweens to be added, do so now - otherwise they can be spliced out of the array before ever running
19405+ if (this._add.length > 0)
19406+ {
19407+ this._tweens = this._tweens.concat(this._add);
19408+ this._add.length = 0;
19409+ }
19410+
1938219411 return true;
1938319412
1938419413 },
@@ -19444,6 +19473,8 @@ Phaser.Tween = function (object, game) {
1944419473
1944519474 this._pausedTime = 0;
1944619475
19476+ this.pendingDelete = false;
19477+
1944719478 // Set all starting values present on the target object
1944819479 for ( var field in object ) {
1944919480 this._valuesStart[ field ] = parseFloat(object[field], 10);
@@ -19598,21 +19629,21 @@ Phaser.Tween.prototype = {
1959819629
1959919630 },
1960019631
19601- onStart : function ( callback ) {
19632+ onStartCallback : function ( callback ) {
1960219633
1960319634 this._onStartCallback = callback;
1960419635 return this;
1960519636
1960619637 },
1960719638
19608- onUpdate : function ( callback ) {
19639+ onUpdateCallback : function ( callback ) {
1960919640
1961019641 this._onUpdateCallback = callback;
1961119642 return this;
1961219643
1961319644 },
1961419645
19615- onComplete : function ( callback ) {
19646+ onCompleteCallback : function ( callback ) {
1961619647
1961719648 this._onCompleteCallback = callback;
1961819649 return this;
@@ -19630,6 +19661,11 @@ Phaser.Tween.prototype = {
1963019661
1963119662 update: function ( time ) {
1963219663
19664+ if (this.pendingDelete)
19665+ {
19666+ return false;
19667+ }
19668+
1963319669 if (this._paused || time < this._startTime) {
1963419670
1963519671 return true;
@@ -20819,8 +20855,8 @@ Phaser.Animation.prototype = {
2081920855
2082020856 if (frameRate !== null)
2082120857 {
20822- // this.delay = 1000 / frameRate;
20823- this.delay = frameRate;
20858+ this.delay = 1000 / frameRate;
20859+ // this.delay = frameRate;
2082420860 }
2082520861
2082620862 if (loop !== null)
@@ -21421,14 +21457,14 @@ Phaser.Animation.FrameData.prototype = {
2142121457 * @param {Array} [output] Optional array. If given the results will be appended to the end of this Array, otherwise a new array is created.
2142221458 * @return {Array} An array of all Frame indexes matching the given names or IDs.
2142321459 */
21424- getFrameIndexes: function (input , useNumericIndex, output) {
21460+ getFrameIndexes: function (frames , useNumericIndex, output) {
2142521461
2142621462 if (typeof useNumericIndex === "undefined") { useNumericIndex = true; }
2142721463 if (typeof output === "undefined") { output = []; }
2142821464
2142921465 if (typeof frames === "undefined" || frames.length == 0)
2143021466 {
21431- // No input array, so we loop through all frames
21467+ // No frames array, so we loop through all frames
2143221468 for (var i = 0, len = this._frames.length; i < len; i++)
2143321469 {
2143421470 output.push(this._frames[i].index);
@@ -21437,16 +21473,16 @@ Phaser.Animation.FrameData.prototype = {
2143721473 else
2143821474 {
2143921475 // Input array given, loop through that instead
21440- for (var i = 0, len = input .length; i < len; i++)
21476+ for (var i = 0, len = frames .length; i < len; i++)
2144121477 {
21442- // Does the input array contain names or indexes?
21478+ // Does the frames array contain names or indexes?
2144321479 if (useNumericIndex)
2144421480 {
21445- output.push(input [i].index);
21481+ output.push(frames [i].index);
2144621482 }
2144721483 else
2144821484 {
21449- output.push(this.getFrameByName(input [i]).index);
21485+ output.push(this.getFrameByName(frames [i]).index);
2145021486 }
2145121487 }
2145221488 }
@@ -21613,6 +21649,7 @@ Phaser.Animation.Parser = {
2161321649 );
2161421650
2161521651 PIXI.TextureCache[uuid].realSize = frames[i].spriteSourceSize;
21652+ // PIXI.TextureCache[uuid].realSize = frames[i].sourceSize;
2161621653 PIXI.TextureCache[uuid].trim.x = 0;
2161721654 }
2161821655 }
@@ -21682,6 +21719,7 @@ Phaser.Animation.Parser = {
2168221719 );
2168321720
2168421721 PIXI.TextureCache[uuid].realSize = frames[key].spriteSourceSize;
21722+ // PIXI.TextureCache[uuid].realSize = frames[key].sourceSize;
2168521723 PIXI.TextureCache[uuid].trim.x = 0;
2168621724 }
2168721725
0 commit comments