|
|
* Example: Pause button, shooting, selecting, jumping, one-time click interactions.
|
|
* Example: Pause button, shooting, selecting, jumping, one-time click interactions.
|
|
|
It's very common that you want an action to be only triggered once, in the moment when the key is _released_. For instance when opening a door, flipping a boolean state, or picking up an item. To achieve that, you use an `ActionListener` and test for `… && !keyPressed`. For an example, look at the Pause button code:
|
|
It's very common that you want an action to be only triggered once, in the moment when the key is _released_. For instance when opening a door, flipping a boolean state, or picking up an item. To achieve that, you use an `ActionListener` and test for `… && !keyPressed`. For an example, look at the Pause button code:
|