- commit
- 1aeadaa8916bbd92f718b0718a450e8282cc7706
- parent
- 7af25ceb41a6a1dd1db7e6ce50bf16902b8bfdf6
- Author
- radow <masteroftheriddles@googlemail.com>
- Date
- 2019-10-26 14:35
Merge branch 'master' of https://git.hemio.de/radow/game-of-death
Diffstat
| M | src/logic.js | 2 | +- |
| M | src/template.js | 10 | ++++++++++ |
2 files changed, 11 insertions, 1 deletions
diff --git a/src/logic.js b/src/logic.js
@@ -38,7 +38,7 @@ export const calculateNextGen = function(state) {
38 38 // Conflate all playerevolutions by clearing tiles that would be claimed by multiple players
39 39 for (let y = 0; y < constants.height; y++) {
40 40 for (let x = 0; x < constants.width; x++) {
41 -1 if(board[y][x] == constants.GAIA) continue;
-1 41 if (board[y][x] === constants.GAIA) continue;
42 42 let empty = true;
43 43 board[y][x] = constants.EMPTY;
44 44 for (let p = 1; p < constants.playerCount; p++) {
diff --git a/src/template.js b/src/template.js
@@ -21,19 +21,29 @@ const renderControls = function(state) {
21 21 if (state.game.sandbox) {
22 22 return h('div', {'class': 'board-controls'}, [
23 23 h('input', {type: 'range', value: 50, name: 'speed'}),
-1 24 ' ',
24 25 h('input', {type: 'number', value: 1, name: 'steps'}),
-1 26 ' ',
25 27 h('button', {'class': 'js-next-gen'}, 'Next Gen'),
-1 28 ' ',
26 29 h('button', {'class': 'js-play'}, state.game.playing ? 'Pause' : 'Play'),
-1 30 ' ',
27 31 h('button', {'class': 'js-current-player fg-' + state.game.currentPlayer}, 'Current Player'),
-1 32 ' ',
28 33 h('button', {'class': 'js-export'}, 'Export'),
-1 34 ' ',
29 35 h('button', {'class': 'js-quit'}, 'Quit'),
30 36 ]);
31 37 } else {
32 38 return h('div', {'class': 'board-controls'}, [
33 39 h('input', {type: 'range', value: 50, name: 'speed'}),
-1 40 ' ',
34 41 h('input', {type: 'hidden', value: 50, name: 'speed'}),
-1 42 ' ',
35 43 h('input', {type: 'hidden', value: 1, name: 'steps'}),
-1 44 ' ',
36 45 h('button', {'class': 'js-play'}, state.game.playing ? 'Pause' : 'Play'),
-1 46 ' ',
37 47 h('button', {'class': 'js-quit'}, 'Quit'),
38 48 ]);
39 49 }