DELTA-V
DELTA-V is a 16-bit management game about running a launch company from a shed towards Mars. The whole game is one HTML file. There is no game engine, no library, no image file, no sound file and no font file in it: every pixel, glyph and note is produced by code in that file.
01The stack
The game is written in plain JavaScript: ES modules, no TypeScript, no framework, no engine and no runtime library of any kind. Nothing from npm is in the shipped file. It runs on what a browser already has:
| Language | Modern JavaScript, 19 ES modules, about 16.7k lines |
| Graphics | Canvas 2D, used only to put one finished frame on screen: putImageData from a Uint8Array framebuffer through a Uint32Array colour table |
| Sound | Web Audio API: oscillators with custom PeriodicWave pulse shapes, noise buffers, biquad filters and a feedback delay |
| Timing | requestAnimationFrame for the frame, a look-ahead scheduler on the audio clock for the music |
| Storage | localStorage for saves and settings |
| Other browser APIs | Touch events, Fullscreen, Screen Wake Lock, Web Share, and Web Crypto (SHA-256) on the draw page |
| Build | A 183-line Node.js script of our own that joins the modules into the one HTML file. No bundler, no transpiler, no minifier |
The tooling beside the game is allowed dependencies, because none of it ships:
| Test harnesses | Node.js, about 8.7k lines, driving real Chromium through Playwright |
| Art and document tools | Python with Pillow, about 1.4k lines: packs the text sprites and the font into the build |
| QR check | jsQR, to read back the codes the game generates |
02The renderer
The screen is a fixed 480 x 270 buffer of palette indices, one byte a pixel, not colours. There are 56 colours and the buffer cannot hold anything else, so an off-palette pixel is not a style rule that someone has to remember: it is unrepresentable. Once a frame the buffer is converted to RGBA through a lookup table and scaled to the display without smoothing.
The interface is drawn the same way, pixel by pixel, in immediate mode: there is no DOM and no CSS inside the game. Text uses one hand-authored 5 x 8 bitmap font of 107 glyphs.
03Art is source code
Sprites are text. Each one is a grid of characters in the repository, one character a pixel, and a build step packs them into the file:
.......a....... ......9a9...... .....89a98..... ....789a987.... ....7d9a9d7....
Anything that is mathematics is computed instead of drawn: planets are spheres lit per pixel, starfields and terrain scatter are hashed, gradients are dithered with a 4 x 4 Bayer matrix, exhaust is particles. The cinematics are a 1x world framed by a 2x camera, with the sky painted separately at screen scale so its dither stays one pixel fine.
04Sound
There are no audio files. Every effect and all seven soundtracks are synthesised at run time with the Web Audio API from pulse waves and filtered noise. A soundtrack is three tables of note numbers (bass, chords, lead) and a tempo. The stand edition's theme speeds up by an eighth in the last minute of a session.
05The simulation
The game's model is a pure module: no screen, no timers, no browser. One tick is one week. All randomness comes from a seeded generator kept in the game state, so a seed replays identically.
That purity is what makes the game testable at scale. Balance is not tuned by feel: the model is played headlessly, thousands of runs at a time, by scripted players. The eight-minute stand edition is its own ruleset on the same engine, and it is checked by simulating visitors with realistic reaction times: an ordinary visitor's first launch comes at about 36 seconds, and roughly one in three reaches the Moon.
06Tests that look and listen
There are 40 tools beside the game, most of them harnesses that drive a real browser. Each one exists because of a defect that could not be seen in a terminal. A few of them:
• every screen is staged and each piece of text is checked for overflow and for contrast against the pixels actually behind it;
• the palette is run through three kinds of colour blindness, and any state told by colour alone fails;
• a finger is simulated: taps, drags, a held press, a phone turned sideways;
• the soundtracks are rendered offline and checked for notes out of key and for clipping;
• thousands of random clicks look for a way to crash the interface.
07Phones
The game is always landscape. On a phone held upright the canvas itself is turned a quarter and the touches are mapped back, so it fills the screen even with the rotation lock on. A finger held still raises a 2x magnifier, because 480 pixels across a five-inch screen makes small text.
08QR codes
The QR codes are made by the game as well. A QR code is Reed-Solomon arithmetic over GF(256) laid into a square: about 230 lines of JavaScript, with no library. Every code is read back by a real decoder in the tests, including the printed one with a logo over its centre.
09The prize draw
The prizes are drawn at random among the best shared scores, in a way anyone can check. The list of entries is frozen at the close and published with its SHA-256. The randomness is one round of drand, a public beacon, and which round is fixed in advance. The winner is SHA-256(listHash:randomness:k) mod n. The draw page runs it live in your browser and prints a few lines of Python that repeat it.