TomFiveThumbs Posted April 4, 2014 Share Posted April 4, 2014 Here are my animationsbaddie.animations.add('fly',[0,1],5,true);baddie.animations.add('hit',[2,0,2],10,false);baddie.animations.play('fly');When the baddie is hit:baddie.animations.play('hit');It plays the hit animation once, then stays on the last frame. Is there a way I can get it to fire an event, or process a function after the animation is done? I can see there is a killOnComplete option, but no onComplete function option. The only real way I can see this working is having a timer or counter, then going back to the fly animation, but that's a bit sloppy and could get annoying with multiple baddies. Link to comment Share on other sites More sharing options...
TomFiveThumbs Posted April 4, 2014 Author Share Posted April 4, 2014 Found it. http://docs.phaser.io/Phaser.Animation.html onComplete If I knew how to delete threads I'd remove this one! Link to comment Share on other sites More sharing options...
valueerror Posted April 4, 2014 Share Posted April 4, 2014 don't delete.. a clear question with a clear answer is always helpful Link to comment Share on other sites More sharing options...
valueerror Posted April 4, 2014 Share Posted April 4, 2014 haha.. and could you provide an example please ? i cant get my player to start a function after the animation completed... thx in advance Link to comment Share on other sites More sharing options...
Recommended Posts