Jump to content
This forum will be closing down. Please move to the respective dedicated project forums.

animation oddity


evan312
 Share

Recommended Posts

Ok, so I have a basic top-down player with multidirectional movement. I have added a (poor) 2-frame animation but it only works when i use W, S,  UP, or DOWN to move along the Y axis. If i move along the X axis the animation doesn't work and there is a weird vibration look to it.

 

In my code, i set player.walking to true when i am pressing any of the movement buttons, and false when i'm not. Then i have this below that in my update function:

    if (!player.walking){        player.animations.stop();        player.frame = 0;    }    else        player.animations.play('walk');

I have player.walking in the top left as debug text and it evaluates to false when i am trying to move on the x-axis, so is it even an error in my animation code?

 

 

you can see my source here: http://evansphasertest.co.nf/TDS/main.js

and the example is hosted here: http://evansphasertest.co.nf/TDS/ *

* sorry if the connection is bad, it was free

 

 

Thanks so much in advance!

 

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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