Game
Cosmo's Moondrift
liveAn endless moonboarding game. Cosmo, the first kid on the Moon base, rides the dunes of a moon under a ringed giant planet, and it all runs on one button: press to jump, hold in the air to backflip, let go to land flat on the board. A flick in the air does a board trick (a kickflip, a heelflip, a 360 shove-it or the Moon Grab), and a flick on the diagonal does an acrobatic one: a barrel roll, a butterfly twist, a corkscrew, or a slow spacewalk on nothing. He grinds the cables strung between antenna masts, rides crystal walls, bounces on moon jellies and gets thrown up by geysers, and where a chasm is too wide to jump, a light line from his wrist catches a glowing orb and swings him across. Tricks chain into a multiplier that banks after a calm stretch, and a bad landing ends the run. The ride passes through five places, Stardust Dunes, the Crystal Canyons, the Ring Temples, the Aurora Ice Fields and Kaguya Station, over a full day with aurora, meteor showers and a rare eclipse. You can watch it side on, from behind, or from inside his bubble helmet, where the view turns with every backflip. A Mission Log of three missions a level earns embroidered patches, and Cosmo talks Mission Control through the whole run. It makes all of its own music as you play, in a different key for each place, with no recordings to download. It plays on a phone and on a computer, with touch, a mouse, the keyboard or a game controller, and it is one file.
Screenshots
What it does
- A 3D game in one file of about 1.1 MB: the moon, the sky, Cosmo, every texture and every sound are made in the browser as it loads.
- The track proves itself. Every chasm is sized from the game’s own physics when a run starts, and a solver that drives the real player code found no section it could not clear in 30,534 tries, while riding straight off the lip clears none of them.
- Six AI agents built it side by side on one written contract, each owning one part of the game: the track, the world, the sky, Cosmo, the gameplay and the screens.
- After the first play, the sound was rebuilt so a phone can keep up: about 44 synthesised voices at once instead of 90, with the same loudness.
Built with
- HTML5
- Three.js
- WebGL
- Web Audio API
Want the how and why?
I write up builds like this one. What I did, what went wrong, and what is worth copying.
Read the writing

