brianwik Posted July 30, 2014 Share Posted July 30, 2014 Hi all, so I'm still very new to Phaser but I really want to learn this! So my first question is ... instead of holding down the left or right key to move I want to set it so that you have to repeatedly tap the right button to move right instead of holding it down.So every time the right key is tapped a small like 1 frame animation will happen and the character will move say 3 pixels forward. so this will continue every time you tap. hope I made this clear enough and thanks in advance! Link to comment Share on other sites More sharing options...
lewster32 Posted July 30, 2014 Share Posted July 30, 2014 Instead of polling the cursors for isDown in the update like most examples, you'd use the provided Signals (events) on the Key objects, something like this: http://jsfiddle.net/lewster32/mStRx/ This solution isn't totally ideal - it loses the ability to move diagonally for instance, but it should be fine for most applications. If you need diagonals as well, you'd have to add a bit more complexity to the code. Link to comment Share on other sites More sharing options...
Recommended Posts