Home▸Board Games & Game Mathematics▸Pinball Machine: Gravity (2D)

🎮 Pinball Machine: Gravity (2D)

A flat 2D pinball table driven by the same vector-reflection physics as the 3D original: gravity, friction and bumper kick are all live sliders, bumpers and pegs bounce the ball off their contact normal, flippers reflect it off a rotating segment, and you can watch it play itself or take over the flippers by hand.

Board Games & Game Mathematics2DModerate60 FPS📱 Mobile-adapted⇄ 3D version
2d-pinball-machine-gravity ↗ Open standalone

This companion carries the 3D pinball table's own vector-reflection physics into a flat 2D view: gravity pulls the ball down the table, friction bleeds off speed, and every bounce off a bumper, peg or flipper is resolved by reflecting the ball's velocity across the contact normal — the same math the 3D engine uses, just exposed as sliders you can turn live.

About this simulation

Frequently asked questions

How is this different from the original 3D pinball simulation?

The collision physics is the same vector-reflection approach used by the 3D version's bumpers, pegs and flippers, but rendered as a flat top-down 2D canvas instead of a WebGL/Three.js scene, and it exposes friction and bumper-kick as sliders that the 3D version keeps fixed.

How do bumper and peg collisions work?

Bumpers and pegs are circles. When the ball overlaps one, it is pushed back out along the contact normal and its velocity is reflected across that normal (v' = v - 2(v·n)n); bumpers additionally scale the outgoing speed by the bumper-kick factor, while pegs leave speed unchanged.

How do the flippers work?

Each flipper is a rotating line segment. With auto-play on, a flipper swings toward the ball whenever it drifts within range, mirroring the 3D original's proximity trigger. Turning auto-play off lets you fire either flipper yourself with the on-screen buttons or the left/right arrow keys.

What happens when the ball drains?

If the ball passes below both flippers without being caught, it counts as a drain, the drain counter increments, and the ball respawns near the top of the table so play continues without needing to press Launch again.

⚙ Under the hood

A flat 2D pinball table with gravity, friction and bumper-kick sliders, circle-normal reflection off bumpers and pegs, segment reflection off the flippers, and a live score/drain readout with auto-play or manual flipper control.

pinball physicsmomentum transfercollision dynamicstrajectory simulationvector reflection2d

2D · HTML5 Canvas 2D · 60 FPS target · runs fully client-side, no install

What did you find?

Add reproduction steps (optional)