In your app there are also two functions to handle button interaction: onButtonPressed(button) and onButtenReleased(button). These functions are called when a button is pressed or released, the button variable holds the actual button that is pressed or released. The button can have of the following values:
- Button.UP
- Button.DOWN
- Button.LEFT
- Button.RIGHT
- Button.A
- Button.B
In the functions you can easily check if a specific button was pressed by using an if statement like this: if (button === Button.UP).