File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -63,6 +63,7 @@ Version 2.0.4 - "Mos Shirare" - in development
6363* Timer has removed all use of local temporary vars in the core update loop.
6464* The Input.reset ` hard ` reset parameter is now passed down to the Keyboard and Key reset methods.
6565* AnimationManager.destroy now iterates through child animations calling destroy on all of them, avoiding a memory leak (thanks stauzs)
66+ * AnimationManager.play will now call Animation.stop on the current animation before switching to the new one (thanks @nihakue , #713 )
6667
6768
6869### New Features
Original file line number Diff line number Diff line change @@ -195,7 +195,7 @@ Phaser.AnimationManager.prototype = {
195195
196196 if ( this . _anims [ name ] )
197197 {
198- if ( this . currentAnim == this . _anims [ name ] )
198+ if ( this . currentAnim === this . _anims [ name ] )
199199 {
200200 if ( this . currentAnim . isPlaying === false )
201201 {
@@ -205,6 +205,11 @@ Phaser.AnimationManager.prototype = {
205205 }
206206 else
207207 {
208+ if ( this . currentAnim && this . currentAnim . isPlaying )
209+ {
210+ this . currentAnim . stop ( ) ;
211+ }
212+
208213 this . currentAnim = this . _anims [ name ] ;
209214 this . currentAnim . paused = false ;
210215 return this . currentAnim . play ( frameRate , loop , killOnComplete ) ;
You can’t perform that action at this time.
0 commit comments