Drag anywhere on the screen to slide the paddle
Release — the paddle holds position
Edges of the paddle fire the ball off-angle
Thirty-two cyan bricks, three lives, one sixty-pixel paddle dragged by finger or arrow key. Everything you see below is painted by ctx.
No physics engine. A fixed 1/60 accumulator drives the simulation; rendering is decoupled, so a 120 Hz phone animates twice as smoothly without the ball moving twice as fast.
Circle vs. axis-aligned box, resolved on the axis of least penetration:
ox = (w/2 + r) − |dx| · oy = (h/2 + r) − |dy|
dy, eject top/bottom.dx, eject left/right.Hit position maps to a ±60° exit angle: sin(θ)·s / −cos(θ)·s. Centre contact goes almost straight up, corners scream off sideways.
A vertical floor of 0.34·s stops the ball from grinding horizontally forever.
touchstart / move / end + mouse + pointer parity.shadowBlur storm.