Last active
February 24, 2019 22:04
-
-
Save bashbaugh/e9e8bf2a92a998f3b25eaf212bbf12d8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function key_pressed(key) //called when a key is pressed | |
| { | |
| // key.key is the name of the key | |
| if (key.key == "ArrowUp") | |
| { | |
| console.log("up"); | |
| } | |
| if (key.key == "ArrowLeft") | |
| { | |
| console.log("left"); | |
| } | |
| if (key.key == "ArrowRight") | |
| { | |
| console.log("right"); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment