Last active
February 27, 2019 02:20
-
-
Save bashbaugh/021b8f4105425a79cd207cd0ffb8ede6 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) | |
{ | |
... // arrow up block | |
if (key.key == "ArrowLeft") | |
{ | |
console.log("left"); | |
player_x -= player_move_increment // reduce player_move_increment, which moves player left | |
} | |
if (key.key == "ArrowRight") | |
{ | |
console.log("right"); | |
player_x += player_move_increment // increase player_move_increment, which moves player right | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment