evan312 Posted December 27, 2013 Share Posted December 27, 2013 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.jsand 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 More sharing options...
Milton Posted December 28, 2013 Share Posted December 28, 2013 Your X check is useless, since your Y check sets walking to false if you're not doing anything vertical... Link to comment Share on other sites More sharing options...
evan312 Posted December 28, 2013 Author Share Posted December 28, 2013 Thanks, i just made separate player.walkingX and player.walkingY vars and updated my if-check and it works perfectly! Link to comment Share on other sites More sharing options...
Recommended Posts