On Track Math
A 3D maths racing game for kids
- 24lessons
- 72stars to earn
- 9cars
- 577commits
About
On Track Math is a racing game for young children learning arithmetic. A sum appears, the road splits into gates, and you steer through the one with the right answer.
There are four worlds, 24 lessons, 72 stars to earn and nine cars to unlock. It runs in the browser with no account, and keeps progress on the device.
Stack
- Game
- ReactTypeScriptVitethree.jsreact-three-fiber
- Sound
- Web Audio, all synthesised
- Hosting
- Cloudflare Workers
- Testing
- VitestPlaywright visual tests
Technical challenges
Gates that don't give the answer away
Every problem and every gate is worked out in advance, about 8,000 problems, so each number on the board is the right answer exactly a third of the time. You can't win by learning which numbers usually come up.
Three ways to play
Learn waits for you. Practice gives 15 seconds a gate and three hearts. Race gives nine seconds, a clock sized to the hardest lesson so it stays fair everywhere.
3D that doesn't leak
A car that didn't free its geometry leaked 18 objects on the graphics card every time you browsed the showroom. Disposal is now tracked, and a check makes sure the counts stay flat.
Music with no audio files
Every sound effect and a song for each world is synthesised in the browser, on a scheduler that looks a fraction of a second ahead so nothing stutters.
Progress that survives private browsing
Runs are saved as an append-only history on the device, written to cope with the storage errors private browsing throws.
Testing a 3D game
A frozen clock makes every frame repeatable for screenshot tests, and a fuzz test throws random play at the simulation.



