diff --git a/js/game_manager.js b/js/game_manager.js index f60fd2d2420d7577f0005b7dd22eec8c5a16756c..1cab43472e5dd62808161c78f71114a2ca507744 100644 --- a/js/game_manager.js +++ b/js/game_manager.js @@ -83,7 +83,12 @@ GameManager.prototype.actuate = function () { this.storageManager.setBestScore(this.score); } - this.storageManager.setGameState(this.serialize()); + // Clear the state when the game is over (game over only, not win) + if (this.over) { + this.storageManager.clearGameState(); + } else { + this.storageManager.setGameState(this.serialize()); + } this.actuator.actuate(this.grid, { score: this.score,