Members
(static) A
Keycode for a
(static) ANY
Signifies to bind an event to a key event no matter what key is pressed
(static) D
Keycode for d
(static) DOWN
Keycode for down arrow key
(static) KEY_DOWN
Code for binding event to key down
(static) KEY_HELD
Code for binding event to key held
(static) KEY_UP
Code for binding event to key up
(static) LEFT
Keycode for left arrow key
(static) RIGHT
Keycode for right arrow key
(static) S
Keycode for s
(static) SPACE
Keycode for the spacebar
(static) UP
Keycode for up arrow key
(static) W
Keycode for w
Methods
(static) bind(key, keyDir, func)
Binds a function to a key
Parameters:
| Name | Type | Description |
|---|---|---|
key |
Number | the key to bind to |
keyDir |
Number | Key.KEY_UP, Key.KEY_DOWN, or Key.KEY_HELD |
func |
function | the function to bind |
(static) isDown(keyCode)
Checks if a key is currently pressed
Parameters:
| Name | Type | Description |
|---|---|---|
keyCode |
Number | the key to check |
Returns:
true if key is pressed
(static) reset()
Resets what keys are currently pressed
(static) update()
The update function, called from the game update