400 × 600 · 8×4 grid
Drag anywhere on the screen · paddle follows your finger · tap to launch
Drag anywhere on the screen · paddle follows your finger · tap to launch
Under the glass
No engine, no libraries. Explicit axis-aligned bounding-box tests, a fixed timestep, and one collision resolved per sub-step — the way it was done when a frame cost real money.
speed pixels per step on a 60 Hz phone and a 144 Hz monitor alike. Magnitude is re-normalised after every bounce — speed never drifts, only direction.dy and a flank strike flips dx. Only the shallowest overlap of all 32 blocks resolves per sub-step — one hit, one response, no double-flip in a corner, and the ball is pushed clear of the block it just killed.rel = (ballX − centre) / 30 maps the hit point to a ±60° exit angle, biased by 5.5% of the paddle's own velocity for that frame — then re-normalised. Edges give steep deflections, the middle gives a near-vertical return.x ∈ [0, 340] — the paddle cannot leave the field, and its end caps reflect the ball's horizontal velocity like a wall.touchstart / move / end, default-suppressed), mouse tracking and keyboard — each takeover cancels the last so the paddle never jitters between two masters.attract → ready → playing ⇄ paused → over | won. Attract mode plays itself with a chasing AI paddle until you put a coin in; the win/lose screens are drawn on the canvas with a live restart target.drawImage. Particle pool capped, DPR capped at 2, DOM writes only on value change.