32 bricks · 3 lives · 400×600 · AABB
implementation details worth knowing
The ball's AABB is tested against every live brick; the axis with the smaller penetration decides the normal — so a shallow graze flips dx, a head-on drop flips dy.
Corners that touch two bricks resolve only the closest collision, then the ball is pushed clear of that face. No re-collision on the same tick, no brick swallowing the ball.
Physics steps in constant 16.67 ms ticks with a max of 5 catch-up steps, so a 120 Hz phone and a 60 Hz desktop play identically. Speed magnitude never drifts — always renormalised after every bounce.
Contact offset maps to ±62° and paddle velocity adds a small lateral nudge. A minimum vertical component keeps the ball from locking into a flat horizontal bounce.
Starts at 3.4 and climbs 0.02 per destroyed brick, capped at 4.0 — the difficulty ramp lives entirely inside that band.