Clear saved game if game is over
This commit is contained in:
parent
c36f714946
commit
782172c4a7
|
@ -484,6 +484,9 @@
|
||||||
function checkGameOver() {
|
function checkGameOver() {
|
||||||
if (isGameOver()) {
|
if (isGameOver()) {
|
||||||
$('#gameOver').show();
|
$('#gameOver').show();
|
||||||
|
|
||||||
|
//clear saved game
|
||||||
|
localStorage.clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -790,11 +793,11 @@
|
||||||
|
|
||||||
removeClearedRows();
|
removeClearedRows();
|
||||||
removeClearedColumns();
|
removeClearedColumns();
|
||||||
|
saveGame();
|
||||||
checkGameOver();
|
checkGameOver();
|
||||||
|
|
||||||
updateScore();
|
updateScore();
|
||||||
updateMinesLeft();
|
updateMinesLeft();
|
||||||
saveGame();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
$(window).resize(function() {
|
$(window).resize(function() {
|
||||||
|
|
Loading…
Reference in New Issue