Demo

Pinball Demo

Capabilitygames
Pinball Demo

A full 3D pinball machine that runs entirely in the browser. No game engine, no loaded assets, three runtime dependencies, deterministic physics at 120 Hz with continuous collision detection, and 113 automated physics checks.

A complete 3D pinball machine, live in the browser. Built on Three.js with our own physics, game logic and camera work on top, no game engine involved. The whole runtime depends on exactly three libraries, the main bundle is 723 kB, and it ships as a static site behind nginx on Cloud Run. Click once and you are playing.

There is not a single image or sound file in the project. Every surface, from wet concrete to brushed steel to the printed playfield art, is generated at startup from layered noise, complete with normal, roughness and occlusion maps. The audio is synthesized live through the WebAudio API: a flipper is not a thud but an electrical snap followed by a hard mechanical stop, and the rolling noise follows the actual ball speed. No load times, no asset licensing, and variation is a parameter instead of a Photoshop session.

The physics runs at a fixed 120 Hz, decoupled from the display. A hard flipper shot moves the ball up to 83 mm per simulation step, more than three ball radii, which is where naive collision checking silently fails. We solve it with continuous collision detection: the swept path is tested analytically against planes, circles and capsules, measured tunnel-free up to 13.9 m/s. The table itself uses real machine dimensions, a 514 by 1067 mm playfield, a 27 mm steel ball at 80 grams, 6.5 degrees of pitch and 38.2 mm between the flipper tips, the single number that decides whether draining is possible but not automatic.

The flippers are simulated as rotating rigid bodies that transfer angular momentum to the ball, not as animations with a kick attached. Cradling and live catches emerge from the simulation instead of being scripted as special cases. And because the integrator is fully deterministic, the same input always produces the same shot, which is what makes the physics testable in the first place: 113 automated checks cover tunneling, energy conservation over 30 seconds of simulation, 408 drop points across the table with zero stuck spots, and reproducibility, at a cost of 1.3 microseconds per step for three simultaneous balls.

Rendering runs through an HDR pipeline with ambient occlusion, two octaves of bloom, depth of field, filmic tonemapping and SMAA. On startup the game measures its own frame time and steps itself down through eight quality levels until the budget holds, so it stays playable on weak hardware instead of stuttering. After loading, the game makes not a single outgoing network call, no fetch, no telemetry, and keeps working offline.

The same foundation takes a brand instead of a demo skin: playfield art, lighting, sound character and score events are all data, so a campaign machine with its own look and a leaderboard is a configuration exercise, not a rebuild.