Added persistence of game state to localstorage after each move
Added rebuilding of game state from localstoage on page load Added New Game button to allow game restarts now that refreshes resume the game
This commit is contained in:
+10
@@ -15,3 +15,13 @@ Tile.prototype.updatePosition = function (position) {
|
||||
this.x = position.x;
|
||||
this.y = position.y;
|
||||
};
|
||||
|
||||
Tile.prototype.tileState = function () {
|
||||
return {
|
||||
position: {
|
||||
x: this.x,
|
||||
y: this.y
|
||||
},
|
||||
value: this.value
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user