3D Chess.
A full chess game with real physics, in one HTML file.
Playing loads its libraries from cdn.jsdelivr.net, a public CDN, so that host sees the request like any other. Nothing you do in the game is sent to us.
What You’re Playing.
3D Chess is a complete chess game on a rendered wooden board. The pieces are built in code from turned profiles and simple shapes, lit with physically based materials and soft shadows.
The rules are all there: castling, en passant, promotion with a piece picker, check, checkmate, stalemate, and draws by threefold repetition, the fifty-move rule or insufficient material. Moves are logged in standard algebraic notation, and you can undo them.
Turn the AI on and it plays Black: an alpha-beta search with a capture search at the end, up to five plies (half-moves) deep, thinking for at most a second and a half on a desktop. We haven’t measured its strength. When a piece is captured it is not simply removed. The cannon-es physics engine knocks it off the square and lets it tumble across the board, with wood-on-wood sound synthesised on the fly.
What’s in it
- Full rules: castling, en passant, promotion and every kind of draw
- An AI opponent that plays Black, with iterative deepening
- Captured pieces knocked off by a physics engine (cannon-es)
- Move list in algebraic notation, undo, and flip board
- Orbit, zoom and pan camera, tap or click to move
- Wood, felt and sound generated in code, no asset files
How To Play.
Keyboard and mouse
- Click a piece, then a squareMove
- DragOrbit the camera
- ScrollZoom
- Undo, Flip, AI, SoundTake back a move, turn the board, play the AI, mute
Touch
- Tap a piece, then a squareMove
- DragOrbit the camera
- PinchZoom
- Two-finger dragPan
Kael wrote this in a chat conversation, with no building tools, as a single HTML file.