
online, join by room code
AI tiers, Club to Pro Tour
Google sign-in, saved stats
custom Blender art
Challenge
Browser sports games are mostly single-player and forgettable. I wanted squash that feels right to play, and that you can play against a mate over the internet.
Online play adds a harder problem than graphics: two players on different connections have to agree on where the ball is and who won the rally.
Approach
A 3D court in Three.js with every model built in Blender. The rules live in a pure TypeScript core, so the same code runs in the browser and on an authoritative WebSocket server that owns the match.
The rules of squash live in a pure TypeScript core with no rendering or network code. The browser runs it for matches against the AI, and the Node.js game server runs the same core for online matches, so there is one set of rules to test.
Online, the server is authoritative. It runs the match and the browsers render what it decides. Players join a room by code over WebSockets, Google sign-in identifies them, and stats and records are stored in Turso.
The court, players and crowd are rendered with Three.js and bundled with Vite. Every model was built in Blender for this game.
Outcome
Play the AI at four levels, or open a room, share the code and play a friend live. Google sign-in keeps your stats and records across devices.
Four AI tiers run from Club to Pro Tour, so it works as a solo game as well as a two-player one. It is live and playable in the browser now.
Stack
- TypeScript
- Three.js
- Node.js
- WebSockets
- Blender