Canvas build · 400 × 600 · single file

Break/Out

Grid 8 × 4
Bricks 50 × 20
Ball Ø6px
Max score 320
Step 1/60s
Drag / move to steer · tap to launch
Ball never flattens

Physics
notes

Explicit collision maths — no engine. Fixed 60 Hz accumulator keeps a 120 Hz phone and a 60 Hz monitor playing the same game.

Hit testCircle vs AABB — closest point on the brick clamped to the ball centre, then distance check against r = 3.
Side pickSmaller penetration axis wins: vertical overlap ⇒ flip dy, horizontal overlap ⇒ flip dx.
One per frameOnly the closest brick resolves per sub-step, so corners never eat two bricks or reverse twice.
De-penetrateBall is pushed out along the normal before the flip, so it can never be left inside a brick.
Constant speedVelocity is renormalised after every reflection: 3.4 px/f rising to 4.0 px/f as the wall thins.
Paddle angleHit offset maps to ±60°, plus 18 % of paddle momentum. Edges bounce off the sides, not through them.
Anti-grindMinimum vertical component held at 0.30 × speed — no infinite horizontal ping-pong.