Key.isDown
Summary
Listening..... waiting.... watching.... a whole world of possibilities suddenly opens up when you work with key listener functions. We learned these two in this lesson:
- Key.isDown(Key.UP)
- Key.isDown(Key.DOWN)
You'll want to use Key.LEFT and Key.RIGHT to move the ship on the X axis. And guess what, there are quite a few more where that came from! Here's an alphapbetical list:
- Key.BACKSPACE
- Key.CAPSLOCK
- Key.CONTROL
- Key.DELETEKEY
- Key.DOWN
- Key.END
- Key.ENTER
- Key.ESCAPE
- Key.HOME
- Key.INSERT
- Key.LEFT
- Key.PGDN
- Key.PGUP
- Key.RIGHT
- Key.SHIFT
- Key.SPACE
- Key.TAB
- Key.UP
In the next lesson, we'll use math to make our vertical movement a little more natural.