Jump to content

Multiple Animations for One Sprite


Recommended Posts

So I'm still having the problem with my player stopping the wrong animation with the animation manager, if I'm using the correct syntax and all that. 


I have a player sprite which is loaded with a walking right spritesheet and an animation added with the key 'walk'. At the press of a certain Keyboard key I would like to add & play other animations after the key press. This will work as long as I don't stop the walk animation in my player movement function.


Calling player.animations.stop('walk') seems to stop all animations even though I give it the specific key for the walk animations. I have the walk being stopped in a player movement function when no movement key is pressed, and this function is called in update() to allow the player to walk left and right at a key press.


So does anyone know why is this stopping all of my animations?


One thing I could think of was since it's constantly being called when no keys are up in goes through and stops the walk animation and then just ignores the key i have given since walk is gone and deletes the next animation in the list.



Link to comment
Share on other sites


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...