diff --git a/computerOpponents.js b/computerOpponents.js index 3caace6..cd20d1e 100644 --- a/computerOpponents.js +++ b/computerOpponents.js @@ -1,7 +1,3 @@ -function copyArray(array) { - return JSON.parse(JSON.stringify(array)); -} - class ComputerOpponent { constructor(game, player) { this.game = game; diff --git a/constants.js b/constants.js index 45f3dfc..71137a9 100644 --- a/constants.js +++ b/constants.js @@ -100,7 +100,6 @@ const playerPaths = { [14, 8], [14, 7], [14, 6], - [14, 6], [13, 6], [12, 6], [11, 6], @@ -275,4 +274,4 @@ const safeTiles = [ [8, 2], [6, 12], [12, 8], -] \ No newline at end of file +].concat(Object.values(playerPaths).map(path => path[0])); diff --git a/game.js b/game.js index 206ca57..29bc37a 100644 --- a/game.js +++ b/game.js @@ -224,7 +224,7 @@ class Game { const takenStartPositions = tokens[player].map(token => { // TODO: make it not dependent on the translation attribute in the visualization ;_; const translation = token.getAttribute('translation').split(' '); - return [translation[2], translation[0]]; + return [parseInt(translation[2]), parseInt(translation[0])]; }); for (let position of startPositions[player]) { diff --git a/initTiles.js b/initTiles.js index 3706986..fd34be9 100644 --- a/initTiles.js +++ b/initTiles.js @@ -2,26 +2,26 @@ const B = 'blue'; const G = 'green'; const Y = 'yellow'; const R = 'red'; -const X = '#f6e7db'; -const W = '#e4cab9'; -const Z = '#fff5ec'; -const S = '#ffc181'; +const W = '#e4cab9'; // center +const X = '#ffd6b1'; // regular tile, alternating - darker +const Z = '#faf1eb'; // regular tile, alternating - lighter +const S = '#b1b3ff'; // safe spaces const tileColors = [ [B, B, B, B, B, B, X, Z, X, Y, Y, Y, Y, Y, Y], - [B, X, X, X, X, B, Z, Y, Y, Y, X, X, X, X, Y], - [B, X, B, B, X, B, S, Y, X, Y, X, Y, Y, X, Y], - [B, X, B, B, X, B, Z, Y, Z, Y, X, Y, Y, X, Y], - [B, X, X, X, X, B, X, Y, X, Y, X, X, X, X, Y], + [B, Z, Z, Z, Z, B, Z, Y, Y, Y, Z, Z, Z, Z, Y], + [B, Z, B, B, Z, B, S, Y, X, Y, Z, Y, Y, Z, Y], + [B, Z, B, B, Z, B, Z, Y, Z, Y, Z, Y, Y, Z, Y], + [B, Z, Z, Z, Z, B, X, Y, X, Y, Z, Z, Z, Z, Y], [B, B, B, B, B, B, Z, Y, Z, Y, Y, Y, Y, Y, Y], [X, B, X, Z, X, Z, W, W, W, Z, X, Z, S, Z, X], [Z, B, B, B, B, B, W, W, W, G, G, G, G, G, Z], [X, Z, S, Z, X, Z, W, W, W, Z, X, Z, X, G, X], [R, R, R, R, R, R, Z, R, Z, G, G, G, G, G, G], - [R, X, X, X, X, R, X, R, X, G, X, X, X, X, G], - [R, X, R, R, X, R, Z, R, Z, G, X, G, G, X, G], - [R, X, R, R, X, R, X, R, S, G, X, G, G, X, G], - [R, X, X, X, X, R, R, R, Z, G, X, X, X, X, G], + [R, Z, Z, Z, Z, R, X, R, X, G, Z, Z, Z, Z, G], + [R, Z, R, R, Z, R, Z, R, Z, G, Z, G, G, Z, G], + [R, Z, R, R, Z, R, X, R, S, G, Z, G, G, Z, G], + [R, Z, Z, Z, Z, R, R, R, Z, G, Z, Z, Z, Z, G], [R, R, R, R, R, R, X, Z, X, G, G, G, G, G, G], ]; diff --git a/utils.js b/utils.js index 1805aba..df7ead0 100644 --- a/utils.js +++ b/utils.js @@ -10,4 +10,8 @@ function arraysEqual(a, b) { } return true; -} \ No newline at end of file +} + +function copyArray(array) { + return JSON.parse(JSON.stringify(array)); +}