Skip to content

Commit

Permalink
clear game state on game over
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielecirulli committed Mar 22, 2014
1 parent bf1ba51 commit af683a7
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion js/game_manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit af683a7

Please # to comment.