clear game state on game over
clear game state on game over

--- a/js/game_manager.js
+++ b/js/game_manager.js
@@ -83,7 +83,12 @@
     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,

comments