photonstorm/phaser — pull request #713 by nihakue (2014-04-13 17:13:18+00:00)
Title: set current animations isPlaying to false when changing animations

It seemed like a weird behavior to have an animation seem to continue playing after it had been superseded by another animation via an AnimationManager. If this is the intended behavior, I'd be interested to hear why.

###Use case:
//Update function
if @cursors.left.isDown
@goLeft()
else if @cursors.right.isDown
@goRight()
else
@idle()

//Idle function
idle: ->
if @body.touching.down and not @animations.getAnimation('hurt').isPlaying
@animations.play('idle')

//collision function...
@animations.play('hurt')

There could be a better way to achieve the same effect, but like I said, it seems weird to have an animation's isPlaying = true when it isn't the active animation and can no longer finish