- commit
- f5524f025c37e1960f582c56e5d2ec8ea2b4c01b
- parent
- 25c0f01fae595d1f369731fdab0177b54ca214eb
- Author
- Tobias Bengfort <tobias.bengfort@posteo.de>
- Date
- 2020-01-02 10:45
reset winState on restart/reset
Diffstat
| M | src/index.js | 3 | +++ |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/index.js b/src/index.js
@@ -61,6 +61,7 @@ const createGame = function(scenario) {
61 61 playing: false,
62 62 steps: 0,
63 63 turnCounter: 0,
-1 64 winState: null,
64 65 resetGame: {
65 66 board: clone(scenario.board),
66 67 tileLimit: scenario.tileLimit || Infinity,
@@ -117,6 +118,7 @@ on('click', '.js-play', function(state) {
117 118
118 119 on('click', '.js-reset', function(state) {
119 120 state.game.playing = false;
-1 121 state.game.winState = null;
120 122 state.game.board = clone(state.game.resetGame.board);
121 123 state.game.turnCounter = state.game.resetGame.turnCounter;
122 124 state.game.tileLimit = state.game.resetGame.tileLimit;
@@ -124,6 +126,7 @@ on('click', '.js-reset', function(state) {
124 126
125 127 on('click', '.js-restart', function(state) {
126 128 state.game.playing = false;
-1 129 state.game.winState = null;
127 130 state.game.board = clone(state.game.restartGame.board);
128 131 state.game.turnCounter = state.game.restartGame.turnCounter;
129 132 state.game.tileLimit = state.game.restartGame.tileLimit;