jvalen Posted June 23, 2015 Share Posted June 23, 2015 Hi there, I have a 4x5(colums x rows) spritesheet. Each of this rows contains different animations applied to the same Sprite object, i.e:this.load.spritesheet('body', 'assets/sprites/body.png', 80, 80);this.character = new Character(this.game, x, y, 'body');//Character classvar Character = function(game, x, y, spriteName) {Phaser.Sprite.call(this, game, x, y, spriteName);...The Character class constructor create the default animations:this.animations.add('walk', [0,1,2,0], 10, false);...What I'm asking is for the best way (or just a way...) to update or change eventually the animation frames of a specific animation. For example to [12, 13, 14, 12].I tried creating a new animation like:this.animations.add('walk', [12, 13, 14, 12], 10, false);but it doesn't seem to be working properly. I'm also tried to find a method to update the frame data (like animation.updateFrameData) no luck though. What do you think about it? Thanks! Link to comment Share on other sites More sharing options...
lucidmoon Posted June 24, 2015 Share Posted June 24, 2015 why bother updating frame data? just create another animations, 'walk_2'... Link to comment Share on other sites More sharing options...
Recommended Posts