dandorf Posted October 17, 2014 Share Posted October 17, 2014 I want to make an animation when you take a coin, and when the animation is complete, this animation is destroyed, not consuming resources. I've done that take the currency disappears, then appears the animation, but not destroyed after running animation ... I have the following code: var anim = game.add.sprite(coin.x, coin.y, 'coin'); anim .animations.add('walk'); anim .animations.play('walk', 20, false); Link to comment Share on other sites More sharing options...
OttoRobba Posted October 18, 2014 Share Posted October 18, 2014 Since, you are not looping, you can do this: anim .animations.play('walk', 20, false, true);The 4th parameter I just passed is the killOnComplete boolean.http://docs.phaser.io/Phaser.AnimationManager.html#play WombatTurkey and Hipe 2 Link to comment Share on other sites More sharing options...
dandorf Posted October 18, 2014 Author Share Posted October 18, 2014 Just what I needed! Thank you very much. Link to comment Share on other sites More sharing options...
Recommended Posts