diff --git a/game.js b/game.js index 17e571d..f79f0be 100644 --- a/game.js +++ b/game.js @@ -131,14 +131,17 @@ setInterval(() => { // Initialize empty tiles with "e" so to not be confused with out of bounds tiles if (!Table[`${x},${y}`]) Table[`${x},${y}`] = "e"; + let tileColor = mod(y + 1, 3); // Draw tile ctx.strokeStyle = "black"; + ctx.fillStyle = tileColor == 0 ? "#d18b47" : tileColor == 1 ? "#e8ab6f" : "#ffce9e"; ctx.beginPath(); ctx.ellipse( start[0] + x * R3 * r, start[1] + y * r, r, r, 0, 0, 360); - ctx.stroke(); + // ctx.stroke(); + ctx.fill(); ctx.closePath(); @@ -168,17 +171,6 @@ setInterval(() => { [[x + 1, y - 1], [x - 1, y - 1]] ).filter((c) => !checkAvailable(...c) && !checkSameColor(c[0], c[1], x, y)) ); - - moves.forEach((move) => { - ctx.fillStyle = "#55ff5544" - ctx.beginPath(); - ctx.ellipse( - start[0] + (move[0]) * R3 * r, - start[1] + (move[1]) * r, - r, r, 0, 0, 360); - ctx.fill(); - ctx.closePath(); - }); break; case 'b': moves = Moves.diagonal.map( @@ -226,17 +218,6 @@ setInterval(() => { default: break; } - - moves.forEach((move) => { - ctx.fillStyle = "#55ff5544" - ctx.beginPath(); - ctx.ellipse( - start[0] + (move[0]) * R3 * r, - start[1] + (move[1]) * r, - r, r, 0, 0, 360); - ctx.fill(); - ctx.closePath(); - }); } } @@ -249,6 +230,17 @@ setInterval(() => { ); } + moves.forEach((move) => { + ctx.fillStyle = "#55ff5511" + ctx.beginPath(); + ctx.ellipse( + start[0] + (move[0]) * R3 * r, + start[1] + (move[1]) * r, + r / 3, r / 3, 0, 0, 360); + ctx.fill(); + ctx.closePath(); + }); + // Draw debug info // ctx.beginPath(); // ctx.strokeStyle = "blue"; diff --git a/index.html b/index.html index 42544e4..8538286 100644 --- a/index.html +++ b/index.html @@ -39,7 +39,6 @@

Hexagonal Chess Board

---Currently missing features & excuses---

- Win/Lose system: Check yourself
- Check and mate detection: Check yourself
- - Colors: Too lazy
- "En Passant": Idk how to
- Turn system: Check yourself
- AI: Idk how to