fixed pausing
This commit is contained in:
parent
1f068080e3
commit
e2d9458e66
1 changed files with 10 additions and 2 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue