Jump to content

Error with 2.4.2 and Starling Atlas (this.currentFrame.index is undefined)


Ironcheese
 Share

Recommended Posts

Hey everyone,

 

my game was running on phaser 2.3.0.

Today I upgraded to phaser 2.4.2 (using a custom build without p2 and ninja physics) and since then I always get this error as soon my sprite should play a animation.

 

The Error in the console.

Uncaught TypeError: Cannot read property 'index' of undefinedc.Animation.updateCurrentFrame @ phaser-arcade-physics.js:52599c.Animation.play @ phaser-arcade-physics.js:52339c.AnimationManager.play @ phaser-arcade-physics.js:51855Player.create @ Player.js:64playState.create @ play.js:22c.StateManager.loadComplete @ phaser-arcade-physics.js:17000c.StateManager.preUpdate @ phaser-arcade-physics.js:16778c.Game.updateLogic @ phaser-arcade-physics.js:25146c.Game.update @ phaser-arcade-physics.js:25094c.RequestAnimationFrame.updateRAF @ phaser-arcade-physics.js:45825c.RequestAnimationFrame.start.window.requestAnimationFrame.forceSetTimeOut._onLoop @ phaser-arcade-physics.js:45809

I have a Player Object which uses a spritesheet with an starling xml file.

Inside my Player create method:

this.sprite = game.add.sprite(-300,300,"player");game.physics.enable(this.sprite, Phaser.Physics.ARCADE);this.sprite.anchor.setTo(0.5,0.5);this.sprite.body.gravity.y = -200;this.sprite.body.maxVelocity.setTo(400);this.sprite.body.setSize(40, 80, -10, 0);this.sprite.animations.add("happy",   Phaser.Animation.generateFrameNames("Happy",0,29,'',4),	60, false, false);this.sprite.animations.add("fly",     Phaser.Animation.generateFrameNames("Idle",30,59,'',4),	60, true,  false);this.sprite.animations.add("scared",  Phaser.Animation.generateFrameNames("Scared",60,89,'',4), 60, false, false);this.sprite.animations.add("shocked", Phaser.Animation.generateFrameNames("Shocked",90,159,'',4),60,false, false);var happyAnimation = this.sprite.animations.getAnimation("happy");happyAnimation.onComplete.add(this.eventAnimationComplete, this);var shockedAnimation = this.sprite.animations.getAnimation("shocked");shockedAnimation.onComplete.add(this.eventAnimationComplete, this);this.sprite.animations.play("fly"); // As soon the parser hits this line, the error above is thrown

Digging deeper into the matter it shows that the "index" of this.currentFrame is undefined.

/*** Changes the currentFrame per the _frameIndex, updates the display state,* and triggers the update signal.** Returns true if the current frame update was 'successful', false otherwise.** @method Phaser.Animation#updateCurrentFrame* @private* @param {boolean} signalUpdate - If true the `Animation.onUpdate` signal will be dispatched.* @param {boolean} fromPlay - Was this call made from the playing of a new animation?* @return {boolean} True if the current frame was updated, otherwise false.*/updateCurrentFrame: function (signalUpdate, fromPlay) {    if (fromPlay === undefined) { fromPlay = false; }    if (!this._frameData)    {        // The animation is already destroyed, probably from a callback        return false;    }            //  Previous index    var idx = this.currentFrame.index; // <--- Undefined index    this.currentFrame = this._frameData.getFrame(this._frames[this._frameIndex]);    if (this.currentFrame && (fromPlay || (!fromPlay && idx !== this.currentFrame.index)))    {        this._parent.setFrame(this.currentFrame);    }    if (this.onUpdate && signalUpdate)    {        this.onUpdate.dispatch(this, this.currentFrame);        // False if the animation was destroyed from within a callback        return !!this._frameData;    }    else    {        return true;    }},

My texture XML File looks like this:

<?xml version="1.0" encoding="utf-8"?><TextureAtlas imagePath="Snowman.png">	<!-- Created with Adobe Flash Professional version 15.0.1.179 -->	<!-- http://www.adobe.com/products/flash.html -->	<SubTexture name="Happy0000" x="540" y="1567" width="130" height="95" pivotX="115.05" pivotY="-6.2" frameX="0" frameY="-7" frameWidth="130" frameHeight="102"/>	<SubTexture name="Happy0001" x="138" y="1700" width="130" height="96" frameX="0" frameY="-6" frameWidth="130" frameHeight="102"/>	<SubTexture name="Happy0002" x="272" y="1590" width="130" height="96" frameX="0" frameY="-6" frameWidth="130" frameHeight="102"/>	<SubTexture name="Happy0003" x="540" y="1165" width="130" height="97" frameX="0" frameY="-5" frameWidth="130" frameHeight="102"/>	<SubTexture name="Happy0004" x="674" y="848" width="130" height="98" frameX="0" frameY="-4" frameWidth="130" frameHeight="102"/>	<SubTexture name="Happy0005" x="674" y="642" width="130" height="99" frameX="0" frameY="-3" frameWidth="130" frameHeight="102"/>	<SubTexture name="Happy0006" x="4" y="1092" width="130" height="100" frameX="0" frameY="-2" frameWidth="130" frameHeight="102"/>	<SubTexture name="Happy0007" x="406" y="550" width="130" height="101" frameX="0" frameY="-1" frameWidth="130" frameHeight="102"/>	<SubTexture name="Happy0008" x="540" y="439" width="130" height="101" frameX="0" frameY="-1" frameWidth="130" frameHeight="102"/>	<SubTexture name="Happy0009" x="808" y="112" width="130" height="102"/>	<SubTexture name="Happy0010" x="674" y="328" width="130" height="101" frameX="0" frameY="-1" frameWidth="130" frameHeight="102"/>	<SubTexture name="Happy0011" x="138" y="981" width="130" height="100" frameX="0" frameY="-2" frameWidth="130" frameHeight="102"/>	<SubTexture name="Happy0012" x="808" y="532" width="130" height="99" frameX="0" frameY="-3" frameWidth="130" frameHeight="102"/>	<SubTexture name="Happy0013" x="4" y="1300" width="130" height="99" frameX="0" frameY="-3" frameWidth="130" frameHeight="102"/>	<SubTexture name="Happy0014" x="674" y="1052" width="130" height="97" frameX="0" frameY="-5" frameWidth="130" frameHeight="102"/>	<SubTexture name="Happy0015" x="808" y="738" width="130" height="98" frameX="0" frameY="-4" frameWidth="130" frameHeight="102"/>	<SubTexture name="Happy0016" x="4" y="1506" width="130" height="98" frameX="0" frameY="-4" frameWidth="130" frameHeight="102"/>	<SubTexture name="Happy0017" x="138" y="1189" width="130" height="99" frameX="0" frameY="-3" frameWidth="130" frameHeight="102"/>	<SubTexture name="Happy0018" x="272" y="1079" width="130" height="99" frameX="0" frameY="-3" frameWidth="130" frameHeight="102"/>	<SubTexture name="Happy0019" x="272" y="871" width="130" height="100" frameX="0" frameY="-2" frameWidth="130" frameHeight="102"/>	<SubTexture name="Happy0020" x="406" y="760" width="130" height="100" frameX="0" frameY="-2" frameWidth="130" frameHeight="102"/>	<SubTexture name="Happy0021" x="808" y="218" width="130" height="101" frameX="0" frameY="-1" frameWidth="130" frameHeight="102"/>	<SubTexture name="Happy0022" x="4" y="987" width="130" height="101" frameX="0" frameY="-1" frameWidth="130" frameHeight="102"/>	<SubTexture name="Happy0023" x="540" y="649" width="130" height="100" frameX="0" frameY="-2" frameWidth="130" frameHeight="102"/>	<SubTexture name="Happy0024" x="406" y="968" width="130" height="99" frameX="0" frameY="-3" frameWidth="130" frameHeight="102"/>	<SubTexture name="Happy0025" x="540" y="857" width="130" height="99" frameX="0" frameY="-3" frameWidth="130" frameHeight="102"/>	<SubTexture name="Happy0026" x="138" y="1395" width="130" height="98" frameX="0" frameY="-4" frameWidth="130" frameHeight="102"/>	<SubTexture name="Happy0027" x="808" y="942" width="130" height="97" frameX="0" frameY="-5" frameWidth="130" frameHeight="102"/>	<SubTexture name="Happy0028" x="406" y="1479" width="130" height="96" frameX="0" frameY="-6" frameWidth="130" frameHeight="102"/>	<SubTexture name="Happy0029" x="540" y="1567" width="130" height="95" frameX="0" frameY="-7" frameWidth="130" frameHeight="102"/>	<SubTexture name="Idle0000" x="540" y="1567" width="130" height="95" pivotX="115.05" pivotY="-6.2" frameX="0" frameY="-5" frameWidth="130" frameHeight="102"/>	<SubTexture name="Idle0001" x="674" y="1454" width="130" height="95" frameX="0" frameY="-5" frameWidth="130" frameHeight="100"/>	<SubTexture name="Idle0002" x="808" y="1344" width="130" height="95" frameX="0" frameY="-5" frameWidth="130" frameHeight="100"/>	<SubTexture name="Idle0003" x="540" y="1666" width="130" height="95" frameX="0" frameY="-5" frameWidth="130" frameHeight="100"/>	<SubTexture name="Idle0004" x="540" y="1367" width="130" height="96" frameX="0" frameY="-4" frameWidth="130" frameHeight="100"/>	<SubTexture name="Idle0005" x="674" y="1254" width="130" height="96" frameX="0" frameY="-4" frameWidth="130" frameHeight="100"/>	<SubTexture name="Idle0006" x="808" y="1144" width="130" height="96" frameX="0" frameY="-4" frameWidth="130" frameHeight="100"/>	<SubTexture name="Idle0007" x="272" y="1690" width="130" height="96" frameX="0" frameY="-4" frameWidth="130" frameHeight="100"/>	<SubTexture name="Idle0008" x="406" y="1579" width="130" height="96" frameX="0" frameY="-4" frameWidth="130" frameHeight="100"/>	<SubTexture name="Idle0009" x="4" y="1710" width="130" height="97" frameX="0" frameY="-3" frameWidth="130" frameHeight="100"/>	<SubTexture name="Idle0010" x="138" y="1599" width="130" height="97" frameX="0" frameY="-3" frameWidth="130" frameHeight="100"/>	<SubTexture name="Idle0011" x="138" y="1599" width="130" height="97" frameX="0" frameY="-3" frameWidth="130" frameHeight="100"/>	<SubTexture name="Idle0012" x="272" y="1489" width="130" height="97" frameX="0" frameY="-3" frameWidth="130" frameHeight="100"/>	<SubTexture name="Idle0013" x="272" y="1285" width="130" height="98" frameX="0" frameY="-2" frameWidth="130" frameHeight="100"/>	<SubTexture name="Idle0014" x="406" y="1174" width="130" height="98" frameX="0" frameY="-2" frameWidth="130" frameHeight="100"/>	<SubTexture name="Idle0015" x="540" y="1063" width="130" height="98" frameX="0" frameY="-2" frameWidth="130" frameHeight="100"/>	<SubTexture name="Idle0016" x="674" y="950" width="130" height="98" frameX="0" frameY="-2" frameWidth="130" frameHeight="100"/>	<SubTexture name="Idle0017" x="674" y="745" width="130" height="99" frameX="0" frameY="-1" frameWidth="130" frameHeight="100"/>	<SubTexture name="Idle0018" x="674" y="745" width="130" height="99" frameX="0" frameY="-1" frameWidth="130" frameHeight="100"/>	<SubTexture name="Idle0019" x="674" y="538" width="130" height="100"/>	<SubTexture name="Idle0020" x="808" y="635" width="130" height="99" frameX="0" frameY="-1" frameWidth="130" frameHeight="100"/>	<SubTexture name="Idle0021" x="808" y="635" width="130" height="99" frameX="0" frameY="-1" frameWidth="130" frameHeight="100"/>	<SubTexture name="Idle0022" x="674" y="950" width="130" height="98" frameX="0" frameY="-2" frameWidth="130" frameHeight="100"/>	<SubTexture name="Idle0023" x="808" y="840" width="130" height="98" frameX="0" frameY="-2" frameWidth="130" frameHeight="100"/>	<SubTexture name="Idle0024" x="406" y="1378" width="130" height="97" frameX="0" frameY="-3" frameWidth="130" frameHeight="100"/>	<SubTexture name="Idle0025" x="540" y="1266" width="130" height="97" frameX="0" frameY="-3" frameWidth="130" frameHeight="100"/>	<SubTexture name="Idle0026" x="540" y="1467" width="130" height="96" frameX="0" frameY="-4" frameWidth="130" frameHeight="100"/>	<SubTexture name="Idle0027" x="674" y="1454" width="130" height="95" frameX="0" frameY="-4" frameWidth="130" frameHeight="100"/>	<SubTexture name="Idle0028" x="674" y="1454" width="130" height="95" frameX="0" frameY="-5" frameWidth="130" frameHeight="100"/>	<SubTexture name="Idle0029" x="540" y="1567" width="130" height="95" frameX="0" frameY="-5" frameWidth="130" frameHeight="102"/>	<SubTexture name="Scared0000" x="540" y="1567" width="130" height="95" pivotX="115.05" pivotY="-6.2" frameX="0" frameY="-11" frameWidth="130" frameHeight="102"/>	<SubTexture name="Scared0001" x="674" y="1553" width="130" height="95" frameX="0" frameY="-11" frameWidth="130" frameHeight="106"/>	<SubTexture name="Scared0002" x="808" y="1443" width="130" height="95" frameX="0" frameY="-11" frameWidth="130" frameHeight="106"/>	<SubTexture name="Scared0003" x="540" y="1765" width="130" height="94" frameX="0" frameY="-12" frameWidth="130" frameHeight="106"/>	<SubTexture name="Scared0004" x="674" y="1652" width="130" height="95" frameX="0" frameY="-11" frameWidth="130" frameHeight="106"/>	<SubTexture name="Scared0005" x="674" y="1354" width="130" height="96" frameX="0" frameY="-10" frameWidth="130" frameHeight="106"/>	<SubTexture name="Scared0006" x="674" y="1153" width="130" height="97" frameX="0" frameY="-9" frameWidth="130" frameHeight="106"/>	<SubTexture name="Scared0007" x="4" y="1608" width="130" height="98" frameX="0" frameY="-8" frameWidth="130" frameHeight="106"/>	<SubTexture name="Scared0008" x="4" y="1403" width="130" height="99" frameX="0" frameY="-7" frameWidth="130" frameHeight="106"/>	<SubTexture name="Scared0009" x="808" y="428" width="130" height="100" frameX="0" frameY="-6" frameWidth="130" frameHeight="106"/>	<SubTexture name="Scared0010" x="138" y="876" width="130" height="101" frameX="0" frameY="-5" frameWidth="130" frameHeight="106"/>	<SubTexture name="Scared0011" x="4" y="881" width="130" height="102" frameX="0" frameY="-4" frameWidth="130" frameHeight="106"/>	<SubTexture name="Scared0012" x="138" y="663" width="130" height="103" frameX="0" frameY="-3" frameWidth="130" frameHeight="106"/>	<SubTexture name="Scared0013" x="540" y="114" width="130" height="105" frameX="0" frameY="-1" frameWidth="130" frameHeight="106"/>	<SubTexture name="Scared0014" x="4" y="4" width="130" height="106"/>	<SubTexture name="Scared0015" x="674" y="4" width="130" height="105" frameX="0" frameY="-1" frameWidth="130" frameHeight="106"/>	<SubTexture name="Scared0016" x="4" y="664" width="130" height="105" frameX="0" frameY="-1" frameWidth="130" frameHeight="106"/>	<SubTexture name="Scared0017" x="674" y="113" width="130" height="104" frameX="0" frameY="-2" frameWidth="130" frameHeight="106"/>	<SubTexture name="Scared0018" x="272" y="553" width="130" height="103" frameX="0" frameY="-3" frameWidth="130" frameHeight="106"/>	<SubTexture name="Scared0019" x="406" y="443" width="130" height="103" frameX="0" frameY="-3" frameWidth="130" frameHeight="106"/>	<SubTexture name="Scared0020" x="138" y="770" width="130" height="102" frameX="0" frameY="-4" frameWidth="130" frameHeight="106"/>	<SubTexture name="Scared0021" x="138" y="770" width="130" height="102" frameX="0" frameY="-4" frameWidth="130" frameHeight="106"/>	<SubTexture name="Scared0022" x="272" y="766" width="130" height="101" frameX="0" frameY="-5" frameWidth="130" frameHeight="106"/>	<SubTexture name="Scared0023" x="406" y="655" width="130" height="101" frameX="0" frameY="-5" frameWidth="130" frameHeight="106"/>	<SubTexture name="Scared0024" x="4" y="1196" width="130" height="100" frameX="0" frameY="-6" frameWidth="130" frameHeight="106"/>	<SubTexture name="Scared0025" x="138" y="1085" width="130" height="100" frameX="0" frameY="-6" frameWidth="130" frameHeight="106"/>	<SubTexture name="Scared0026" x="138" y="1292" width="130" height="99" frameX="0" frameY="-7" frameWidth="130" frameHeight="106"/>	<SubTexture name="Scared0027" x="272" y="1182" width="130" height="99" frameX="0" frameY="-7" frameWidth="130" frameHeight="106"/>	<SubTexture name="Scared0028" x="138" y="1497" width="130" height="98" frameX="0" frameY="-8" frameWidth="130" frameHeight="106"/>	<SubTexture name="Scared0029" x="272" y="1387" width="130" height="98" frameX="0" frameY="-8" frameWidth="130" frameHeight="106"/>	<SubTexture name="Shocked0000" x="540" y="1567" width="130" height="95" pivotX="115.05" pivotY="-6.2" frameX="0" frameY="-7" frameWidth="130" frameHeight="102"/>	<SubTexture name="Shocked0001" x="674" y="1553" width="130" height="95" frameX="0" frameY="-7" frameWidth="130" frameHeight="106"/>	<SubTexture name="Shocked0002" x="808" y="1443" width="130" height="95" frameX="0" frameY="-7" frameWidth="130" frameHeight="106"/>	<SubTexture name="Shocked0003" x="540" y="1765" width="130" height="94" frameX="0" frameY="-8" frameWidth="130" frameHeight="106"/>	<SubTexture name="Shocked0004" x="808" y="1542" width="130" height="95" frameX="0" frameY="-7" frameWidth="130" frameHeight="106"/>	<SubTexture name="Shocked0005" x="808" y="1641" width="130" height="95" frameX="0" frameY="-7" frameWidth="130" frameHeight="106"/>	<SubTexture name="Shocked0006" x="272" y="975" width="130" height="100" frameX="0" frameY="-6" frameWidth="130" frameHeight="106"/>	<SubTexture name="Shocked0007" x="540" y="544" width="130" height="101" frameX="0" frameY="-5" frameWidth="130" frameHeight="106"/>	<SubTexture name="Shocked0008" x="406" y="864" width="130" height="100" frameX="0" frameY="-5" frameWidth="130" frameHeight="106"/>	<SubTexture name="Shocked0009" x="674" y="433" width="130" height="101" frameX="0" frameY="-4" frameWidth="130" frameHeight="106"/>	<SubTexture name="Shocked0010" x="540" y="332" width="130" height="103" frameX="0" frameY="-3" frameWidth="130" frameHeight="106"/>	<SubTexture name="Shocked0011" x="808" y="4" width="130" height="104" frameX="0" frameY="-2" frameWidth="130" frameHeight="106"/>	<SubTexture name="Shocked0012" x="674" y="221" width="130" height="103" frameX="0" frameY="-2" frameWidth="130" frameHeight="106"/>	<SubTexture name="Shocked0013" x="4" y="773" width="130" height="104" frameX="0" frameY="-1" frameWidth="130" frameHeight="106"/>	<SubTexture name="Shocked0014" x="4" y="114" width="130" height="106"/>	<SubTexture name="Shocked0015" x="138" y="4" width="130" height="106"/>	<SubTexture name="Shocked0016" x="138" y="554" width="130" height="105" frameX="0" frameY="0" frameWidth="130" frameHeight="106"/>	<SubTexture name="Shocked0017" x="272" y="444" width="130" height="105" frameX="0" frameY="0" frameWidth="130" frameHeight="106"/>	<SubTexture name="Shocked0018" x="4" y="224" width="130" height="106"/>	<SubTexture name="Shocked0019" x="4" y="224" width="130" height="106"/>	<SubTexture name="Shocked0020" x="138" y="114" width="130" height="106"/>	<SubTexture name="Shocked0021" x="272" y="4" width="130" height="106"/>	<SubTexture name="Shocked0022" x="272" y="4" width="130" height="106"/>	<SubTexture name="Shocked0023" x="4" y="334" width="130" height="106"/>	<SubTexture name="Shocked0024" x="406" y="334" width="130" height="105" frameX="0" frameY="0" frameWidth="130" frameHeight="106"/>	<SubTexture name="Shocked0025" x="540" y="223" width="130" height="105" frameX="0" frameY="0" frameWidth="130" frameHeight="106"/>	<SubTexture name="Shocked0026" x="540" y="223" width="130" height="105" frameX="0" frameY="0" frameWidth="130" frameHeight="106"/>	<SubTexture name="Shocked0027" x="540" y="223" width="130" height="105" frameX="0" frameY="0" frameWidth="130" frameHeight="106"/>	<SubTexture name="Shocked0028" x="540" y="223" width="130" height="105" frameX="0" frameY="0" frameWidth="130" frameHeight="106"/>	<SubTexture name="Shocked0029" x="138" y="224" width="130" height="106"/>	<SubTexture name="Shocked0030" x="272" y="114" width="130" height="106"/>	<SubTexture name="Shocked0031" x="272" y="114" width="130" height="106"/>	<SubTexture name="Shocked0032" x="272" y="114" width="130" height="106"/>	<SubTexture name="Shocked0033" x="406" y="4" width="130" height="106"/>	<SubTexture name="Shocked0034" x="4" y="444" width="130" height="106"/>	<SubTexture name="Shocked0035" x="138" y="334" width="130" height="106"/>	<SubTexture name="Shocked0036" x="272" y="224" width="130" height="106"/>	<SubTexture name="Shocked0037" x="272" y="224" width="130" height="106"/>	<SubTexture name="Shocked0038" x="406" y="114" width="130" height="106"/>	<SubTexture name="Shocked0039" x="406" y="114" width="130" height="106"/>	<SubTexture name="Shocked0040" x="540" y="4" width="130" height="106"/>	<SubTexture name="Shocked0041" x="540" y="4" width="130" height="106"/>	<SubTexture name="Shocked0042" x="540" y="4" width="130" height="106"/>	<SubTexture name="Shocked0043" x="4" y="554" width="130" height="106"/>	<SubTexture name="Shocked0044" x="138" y="444" width="130" height="106"/>	<SubTexture name="Shocked0045" x="272" y="334" width="130" height="106"/>	<SubTexture name="Shocked0046" x="272" y="334" width="130" height="106"/>	<SubTexture name="Shocked0047" x="272" y="334" width="130" height="106"/>	<SubTexture name="Shocked0048" x="406" y="224" width="130" height="106"/>	<SubTexture name="Shocked0049" x="406" y="224" width="130" height="106"/>	<SubTexture name="Shocked0050" x="272" y="660" width="130" height="102" frameX="0" frameY="0" frameWidth="130" frameHeight="106"/>	<SubTexture name="Shocked0051" x="808" y="323" width="130" height="101" frameX="0" frameY="-1" frameWidth="130" frameHeight="106"/>	<SubTexture name="Shocked0052" x="540" y="753" width="130" height="100" frameX="0" frameY="-2" frameWidth="130" frameHeight="106"/>	<SubTexture name="Shocked0053" x="406" y="1071" width="130" height="99" frameX="0" frameY="-3" frameWidth="130" frameHeight="106"/>	<SubTexture name="Shocked0054" x="540" y="960" width="130" height="99" frameX="0" frameY="-3" frameWidth="130" frameHeight="106"/>	<SubTexture name="Shocked0055" x="406" y="1276" width="130" height="98" frameX="0" frameY="-4" frameWidth="130" frameHeight="106"/>	<SubTexture name="Shocked0056" x="808" y="1043" width="130" height="97" frameX="0" frameY="-5" frameWidth="130" frameHeight="106"/>	<SubTexture name="Shocked0057" x="808" y="1244" width="130" height="96" frameX="0" frameY="-6" frameWidth="130" frameHeight="106"/>	<SubTexture name="Shocked0058" x="406" y="1679" width="130" height="96" frameX="0" frameY="-6" frameWidth="130" frameHeight="106"/>	<SubTexture name="Shocked0059" x="540" y="1567" width="130" height="95" frameX="0" frameY="-7" frameWidth="130" frameHeight="102"/></TextureAtlas>

I am a bit lost right now... any help is appreciated!

Thanks

 

Link to comment
Share on other sites

Oh... I found the error.

 

I had the wrong Frames inside "generateFrameNames"

 

Correct:

this.sprite.animations.add("happy",   Phaser.Animation.generateFrameNames("Happy",	0,29,'',4),	60, false, false);this.sprite.animations.add("fly",     Phaser.Animation.generateFrameNames("Idle", 	0,29,'',4),	60, true,  false);this.sprite.animations.add("scared",  Phaser.Animation.generateFrameNames("Scared",	0,29,'',4), 60, false, false);this.sprite.animations.add("shocked", Phaser.Animation.generateFrameNames("Shocked",0,59,'',4), 60, false, false);

Since I  switched from a numbered array to frameNames I forgot to update the Indexes of the frames *doh*!

Now everything wrongs fine!

 

Thank you for your help ;)

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...