Under the hood
Explicit collision math — no physics engine, no easing tricks. Every bounce is an axis-aligned box test plus a penetration-depth tie-break.
AABB overlap, closest hit wins
The ball is treated as a 6×6 box. Every live brick that overlaps is measured, and only the candidate with the smallest penetration depth is resolved — one brick destroyed per frame, so the ball can never chew through two bricks or get wedged in a seam.
The shortest axis decides the bounce
min(left, right, top, bottom) penetration identifies the face: top/bottom flips dy, left/right flips dx, then the ball is pushed flush to that face. Flipping components preserves velocity magnitude exactly.
Paddle angle is a hit-position map
Hit offset is normalised to -1…1 across the 60px paddle. Edges steer hard sideways, the centre stays near-vertical, and dy is always rebuilt upward so the ball never crawls along the paddle.
Fixed timestep, refresh-rate agnostic
An accumulator steps physics in 1/60s slices with a 5-step cap, so a 120 Hz phone and a 60 Hz desktop behave identically. Rendering happens once per requestAnimationFrame.
Touch that doesn't fight the browser
touchstart / touchmove / touchend with {passive:false} and touch-action:none; finger x is mapped through getBoundingClientRect() into canvas space and lerped onto the paddle, clamped to 0…340. Landscape and portrait both work down to 320px.
Everything drawn on canvas
Field, bricks, paddle, ball, HUD, particles, scanlines, vignette, Game Over / You Won screens and the restart buttons are all canvas-drawn with pointer hit-testing — the DOM is only cabinet chrome.