Detecting Key Presses

How can I detect keypresses for a Flappy Bird game?
Not detecting when the player holds down the key.

Look at this example
https://labs.phaser.io/edit.html?src=src\physics\arcade\direct%20control%20platforms.js

There are a few ways, but probably you would create cursor keys and check isDown in scene update().

it is only using .isDown I want it to detect me pressing my key down and only fire once until the key is released and then repressed.

i did that but the player can just hold down the key and keep jumping.

See JustDown().

1 Like

so load in cursors and replace “.isDown” with “.justDown”?

No, like in the linked example, replace with Phaser.Input.Keyboard.JustDown(someKey).

1 Like

thanks that works!