Last active
September 23, 2015 13:19
-
-
Save hoorayimhelping/fdc65289bad644cda6f1 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
| PS.keyDown = function (key, shift, ctrl, options) { | |
| "use strict"; | |
| if(GAME.running && !GAME.paused){ | |
| movePlayer(key); | |
| if(key == 112){ | |
| PS.timerStop(sTimerID); | |
| PS.debug("Game is paused.\n"); | |
| GAME.paused = true; | |
| } | |
| } | |
| else if(GAME.running && GAME.paused){ | |
| PS.debugClear(); | |
| PS.debug("Game is paused.\n"); | |
| if(key == 112){ | |
| sTimerID = PS.timerStart(GAME.clock, gameUpdate); | |
| PS.debug("Game is unpaused.\n"); | |
| GAME.paused = false; | |
| } | |
| } | |
| else{ | |
| PS.debugClear(); | |
| PS.debug("Press r to restart game!\n"); | |
| if(key == 114){ | |
| GameSetup(); | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment