Browser game

Chess 2.0

Chess with an RPG layer. The king watches and never changes. Everything else can grow.

Chess 2.0 screenshot

What it does

  1. Pieces evolve. A pawn with 2 points becomes a knight or bishop, those become a rook at 6, a rook becomes a queen at 10, and a queen with 20 turns into an Amazon that also moves like a knight.
  2. Captures earn points. 1 for a pawn, 3 for a knight or bishop, 5 for a rook, 10 for a queen.
  3. Play a friend or the computer. Online against a friend, or against an AI at several difficulties, with an optional clock.
  4. Gambling mode. Any capture can become a 50/50 roll that doubles the points or destroys your piece.

How it was built

It started on 13 June 2026 as chess with an RPG layer, in one HTML file. Online play came in August, and so did the work that made it safe.

Decisions that mattered

  • Rules without the page. The move logic was tangled up with dialogs, animations and networking in one function. I pulled it out into a rules engine with no page, timer or network code, so it can be tested on its own.
  • Send the move, not the result. Online play first shipped the whole game state to the other player, who applied it as is, including move-log HTML that could run script. Now each side sends only the move, checks it against its own legal moves, replays it and compares a position hash after every move.
  • Dice nobody controls. Gamble rolls come from a seed both players contribute when they connect, so both boards roll the same result and neither side reports its own outcome.

How it's tested

Three test suites cover the rules engine, the network protocol and replaying a game from its moves.

Where it stands

Live. Play a friend online or the computer.

Made with

  • HTML
  • Vanilla JS
  • WebRTC networking

Latest changes

Full commit log
  1. Oct 16, 2026

    • Serve the game from chess.thebarbellengineer.com
  2. Sep 24, 2026

    • Add MIT license
  3. Aug 12, 2026

    • Keep vendored files byte-identical to upstream
    • Vendor PeerJS, flip the board for Black, and let a dropped game be resumed