Aerion Posted October 19, 2017 Share Posted October 19, 2017 (edited) Hi all. For some reason my Link character from Legend of Zelda won't quit animating & switch back to Idle animation after letting go of the movement keys either left or right arrows. Also, the animation timing is off from the movement speed. What am I doing wrong here? How to fix? Legend of Zelda demo :: https://babylontesting.epizy.com/Phaser.js/legend-of-zelda-a-link-to-the-past-clone-in-phaser/ Legend of Zelda demo code :: view-source:https://babylontesting.epizy.com/Phaser.js/legend-of-zelda-a-link-to-the-past-clone-in-phaser/js/index.js be sure to copy ALL of the above line INCLUDING the 'view-source:' into your web browser Lines 258 - 408, SPECIFICALLY, lines : 340 - 406 are where this bug takes place. Thank you for helping! <3 ~M Edited October 19, 2017 by Mythros Link to comment Share on other sites More sharing options...
Aerion Posted October 19, 2017 Author Share Posted October 19, 2017 Anyone? Link to comment Share on other sites More sharing options...
samme Posted October 19, 2017 Share Posted October 19, 2017 I don't see an idle animation (just 4 walk animations), so you need to do something like sprite.animations.stop(); sprite.frame = 4; For timing, adjust the frameRate argument in animations.add. Link to comment Share on other sites More sharing options...
Aerion Posted October 19, 2017 Author Share Posted October 19, 2017 @samme I basically use the "foot down" as an idle animation frame for now. I tried sprite.animations.stop ( ) and it didn't work during cursors.MYKEY.isUp ( )... Link to comment Share on other sites More sharing options...
Aerion Posted October 20, 2017 Author Share Posted October 20, 2017 Thanks @samme that worked great! I just had to remove that 1st "if" statement & apply what you said & it worked! <3 SOLVED! ~M Link to comment Share on other sites More sharing options...
Recommended Posts