Pinball — Hand-Rolled Rigid-Body Physics, Real DMD Scoreboard
Two flippers, four slingshots, three pop bumpers, multiball, and a dot-matrix display — all on hand-rolled impulse physics. No Box2D.
What this is
A top-down vertical pinball table. Left and right shift fire the flippers. Hold space to charge the plunger, release to launch. Arrow keys nudge the cabinet — push too hard and you'll TILT and lose the ball. The table has two flippers, four slingshots, three pop bumpers, a five-target drop-target bank, lanes, ramps, a scoop hole that captures and ejects, and a score-multiplier ladder (1x to 10x) earned by clearing the drop targets. Hit the scoop three times to spawn multiball. The DMD up top scrolls your score and animates a pixel-by-pixel MULTIBALL! banner with sparkles when triggered. All collisions and impulses are computed by hand — no Box2D, no Matter.js, no third-party physics.
Why this is mind-blowing
Pinball is the canonical "you have to feel the physics" game — and most homebrew pinball is bad because the physics is bad. This one nails the cradle, the slap-save, the ricochet-off-a-fast-flipper that buries the ball in the bumpers. The audio is a tiny synth (sine bell + overtone for chimes, bandpass noise for slingshot kicks, swept square for flipper thuds). Every collision sounds like a real machine. One HTML file. No libraries.
Single-file pinball with real Box2D-style physics, hand-rolled. Complete table: 2 flippers, slingshots, pop bumpers, drop target bank, lanes, ramps, scoop, plunger. Score multiplier ladder. 16×32 dot-matrix display (DMD) scoreboard with animated text. Multiball trigger. Tilt sensor. Chimes, bumper kicks, flipper thuds via Web Audio.
Paste this into Claude, Cursor, or Copilot. Change one thing that matters to you.
What I learned shipping it
- Flipper hits feel right when you compute v = omega × r at the contact point — flipping at speed transfers angular velocity into the ball, slow flips cradle. That single line of math is what separates pinball from collision.
- Sub-step the simulation so no frame moves the ball more than 0.6 × radius — tunneling through thin walls is the bug that ruins every hobby pinball before this one.
- A real DMD is just a circular-dot grid with bit-mapped glyphs. Once you draw the dots with a soft halo and add a scrolling marquee, it instantly reads as 'arcade.'