Substepped motion
The ball moves in up to 8 substeps per frame, each no longer than 0.8 × r. Every substep resolves exactly one brick — the deepest-penetrating one — so tunnelling and double-bounces disappear.
8 × 4 grid — 32 blocks — 3 balls — one paddle
implementation notes · vanilla js · canvas 2d
The ball moves in up to 8 substeps per frame, each no longer than 0.8 × r. Every substep resolves exactly one brick — the deepest-penetrating one — so tunnelling and double-bounces disappear.
Circle is tested as an expanded AABB against each block. The impact axis comes from the ball's previous substep position, with penetration depth as the fallback — so top hits flip dy, side hits flip dx, never both.
Paddle contact maps the hit offset to ±58° from vertical and rebuilds the velocity vector at constant magnitude — edges give flat, aggressive angles, centre gives a near-straight loft. Ball speed ramps 3.4 → 4.0 px/frame as the field empties.
A verticality floor blocks horizontal infinite loops. Velocity is re-normalised every frame so magnitude never drifts. Side-of-paddle and bottom-of-paddle contacts are resolved separately from the top-face bounce.
Pointer and touch events are non-passive with touch-action:none, mapping client coordinates into the 400×600 logical space at any scale. The brick field bakes into a cached offscreen layer; the buffer tracks devicePixelRatio (capped at 2).