Skip to content

Keyboard

dev2alert edited this page Feb 3, 2022 · 1 revision

Home ▸ Keyboard

To start creating keyboard event handlers, you need to initialize their operation:

Player.key.init();

Creating a key click event handler:

Player.key(Keys.YES, (player) => player.spawn());

Where Keys.YES is the bitmask of the keys.
And the handler is taken as the second argument.

Clone this wiki locally