Finwillwin Posted September 13, 2017 Share Posted September 13, 2017 I'm trying to make my character have an animation before the game resets: playerDie: function(){ if(game.lives > 0){ game.lives -= 1; player.animations.play('die'); game.time.events.add(Phaser.Timer.SECOND * 10, player.kill); } Link to comment Share on other sites More sharing options...
Skeptron Posted September 14, 2017 Share Posted September 14, 2017 Animations have callbacks, like onComplete. You could use this callback to kill() the sprite right after the animation is complete. Taz 1 Link to comment Share on other sites More sharing options...
Finwillwin Posted September 19, 2017 Author Share Posted September 19, 2017 Thanks! Link to comment Share on other sites More sharing options...
Finwillwin Posted September 22, 2017 Author Share Posted September 22, 2017 How would I do this again(maybe example code) here is mine. boom.animation.onComplete(game.state.start('Level1')) Link to comment Share on other sites More sharing options...
samid737 Posted September 23, 2017 Share Posted September 23, 2017 https://phaser.io/examples/v2/animation/animation-events Link to comment Share on other sites More sharing options...
Recommended Posts