fixed pausing

This commit is contained in:
Garrett Finucane 2015-08-26 22:34:21 -04:00
parent 1f068080e3
commit e2d9458e66

View file

@ -200,7 +200,12 @@ function updateHighScores (){
$("#2place").text(highscores[1]);
$("#3place").text(highscores[2]);
}
var pausable = true;
function pause(o) {
if(!pausable){
return;
}
pausable = false;
writeHighScores();
var message;
if (o) {
@ -223,7 +228,8 @@ function pause(o) {
hideText();
setTimeout(function() {
gameState = prevGameState;
}, 200)
pausable =true;
}, 300);
} else if (gameState != -2 && gameState !== 0 && gameState !== 2) {
$('#restartBtn').fadeIn(150, "linear");
$('#buttonCont').fadeIn(150, "linear");
@ -232,9 +238,11 @@ function pause(o) {
showText(message);
}
$('#fork-ribbon').fadeIn(150, 'linear');
$("#pauseBtn").attr("src","./images/btn_resume.svg");
prevGameState = gameState;
setTimeout(function() {
pausable = true;
}, 300);
gameState = -1;
}
}