Knight Ride: a game about rogue (chess) knight
15 hours ago
- The game Knight Ride is a browser-based chess puzzle where a knight must reach a target square, capturing enemy pieces for points within a limited number of moves.
- The game was built without game engines or libraries, using only HTML, raw JS, SVGs from Wikipedia, and CSS Grid for layout.
- Key game mechanics include capturing pieces for points (pawn: 1, bishop/knight: 3, rook: 5, queen: 9), a multiplier based on remaining moves, streak bonuses, and a -1 point penalty for being under attack.
- The developer used a global state object for game logic but manually updated the DOM, leading to messy code with data attributes and query selectors.
- Audio implementation faced issues on Safari and iOS, resolved by switching to the soundjs library, though iOS required the ringer switch to be on.
- The source code is available on GitHub, with extensive comments in a single HTML file, and the game can be played at knightride.rakhim.org.