Created
September 23, 2015 12:00
-
-
Save anonymous/069781bdb49d0077320b 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