dandorf Posted October 17, 2014 Report 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); Quote Link to comment Share on other sites More sharing options...
OttoRobba Posted October 18, 2014 Report 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 Hipe and WombatTurkey 2 Quote Link to comment Share on other sites More sharing options...
dandorf Posted October 18, 2014 Author Report Share Posted October 18, 2014 Just what I needed! Thank you very much. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.