Commit c13377fc authored by Tobias Bengfort's avatar Tobias Bengfort
Browse files

support tileLimit in reset

parent 248a5f6e
Pipeline #1792 failed with stage
......@@ -88,6 +88,7 @@ on('click', '.js-play', function(state) {
if (!state.game.playing) {
state.game.gameOnPlay.board = clone(state.game.board);
state.game.gameOnPlay.turnCounter = state.game.turnCounter;
state.game.gameOnPlay.tileLimit = state.game.tileLimit;
}
state.game.playing = !state.game.playing;
play();
......@@ -99,6 +100,7 @@ on('click', '.js-reset', function(state) {
}
state.game.board = clone(state.game.gameOnPlay.board);
state.game.turnCounter = state.game.gameOnPlay.turnCounter;
state.game.tileLimit = state.game.gameOnPlay.tileLimit;
});
on('click', '.js-current-player', function(state) {
......@@ -130,6 +132,7 @@ on('click', '.js-menu-sandbox', function(state) {
sandbox: true,
gameOnPlay: {
board: logic.setupBoard(),
tileLimit: Infinity,
turnCounter: 0,
},
}
......@@ -149,6 +152,7 @@ on('click', '.js-menu-scenario', function(state) {
turnCounter: 0,
gameOnPlay: {
board: clone(scenarios[i].board),
tileLimit: scenarios[i].tileLimit || Infinity,
turnCounter: 0,
},
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment