Skip to content

Commit

Permalink
Add more info about the project
Browse files Browse the repository at this point in the history
Disable debug draws
  • Loading branch information
creeperkafasi committed Jul 12, 2023
1 parent 34d9869 commit ab40fa8
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 16 deletions.
24 changes: 12 additions & 12 deletions game.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ 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();
Expand Down Expand Up @@ -250,17 +250,17 @@ setInterval(() => {
}

// Draw debug info
ctx.beginPath();
ctx.strokeStyle = "blue";
ctx.strokeText(""
// + `${Table[`${x},${y}`] ?? ""}`
+ `(${x},${y})`
,
start[0] + x * R3 * r - r / 2,
start[1] + y * r + r / 2,
);
ctx.closePath();
ctx.stroke();
// ctx.beginPath();
// ctx.strokeStyle = "blue";
// ctx.strokeText(""
// // + `${Table[`${x},${y}`] ?? ""}`
// + `(${x},${y})`
// ,
// start[0] + x * R3 * r - r / 2,
// start[1] + y * r + r / 2,
// );
// ctx.closePath();
// ctx.stroke();
}
}
}, 1000 / 60);
Expand Down
16 changes: 12 additions & 4 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,23 @@
</head>

<body>
<h1>Hexagonal Chess</h1>
<h1>Hexagonal Chess Board</h1>
<canvas width="500" height="500" id="board"></canvas>
<script src="game.js"></script>
<br>
<br>
Built by: <a href="https://deniz.is-a.dev">Deniz Tunç</a>
<h4>---Currently missing features & excuses---</h4>
- Win/Lose system: Check yourself <br>
- Check and mate detection: Check yourself <br>
- Colors: Too lazy <br>
- "En Passant": Idk how to <br>
- Turn system: Check yourself <br>
- AI: Idk how to <br>
<h4>---Credits---</h4>
Built by: <a href="https://deniz.is-a.dev">Deniz Tunç</a> with just Javascript
<br>
Inspired by: <a href="https://www.youtube.com/watch?v=bgR3yESAEVE">CGP Grey</a>
<br>
Reference for rules & board: <a href="https://en.wikipedia.org/wiki/Hexagonal_chess">Wikipedia</a>
<br>
Image Credits:
<a href="https://commons.wikimedia.org/wiki/File:Chess_kdt45.svg">Cburnett</a>, <a
href="http://creativecommons.org/licenses/by-sa/3.0/">CC BY-SA 3.0</a>, via Wikimedia Commons
Expand Down

0 comments on commit ab40fa8

Please sign in to comment.