Sarsen Posted February 15, 2016 Share Posted February 15, 2016 Hi, sorry for my bad english, but a can't find decision. I create standart platformer on phaser, javascript. I use arcade physic. After I pressed a jump button, my character jumps from the ground several times, while I release the button. I want its to jump once. I use this check to pressing: if (keyJump.isDown && player.body.wasTouching.down) Link to comment Share on other sites More sharing options...
veggis Posted February 15, 2016 Share Posted February 15, 2016 Since update is checking for if keyjump.isDown, you can rather add a function when input is pressed. Add this in create method: keyJump.onDown.add(someJumpFunction, this); http://phaser.io/examples/v2/input/keyboard-hotkeys Link to comment Share on other sites More sharing options...
Sarsen Posted February 16, 2016 Author Share Posted February 16, 2016 When I use this method, more other things do not work as they should - animations and frames of characters(((((((((. Someone knows basic algorithms for behavior characters in platformer like super mario or sonic. Please! Link to comment Share on other sites More sharing options...
Recommended Posts