Canvas Arcade BREAK/OUT · single file · zero dependencies
READY FPS60 BEST0

HTML5 Canvas · 400 × 600 · 60 FPS

BREAK/OUT

Thirty-two bricks, one 3-pixel ball, three lives. Physics is hand-rolled: swept AABB contact tests, closest-face resolution, and a paddle that puts real angle on every return.

Score
0
Bricks left
32
Ball vector
0.00 / 0.00
Lives
3
  • Grid 8 × 4 · bricks 50 × 20 px
  • Ball r3 · speed 3.44 → 4.00 px/frame
  • Paddle 60 × 10 at y = 580
  • 320 points maximum
LEVEL 01 32 BRICKS · 3 LIVES · 320 PTS 400 × 600

// CONTROLS

← → SPACE
Move paddleMOUSE · ← → · A D · DRAG
Launch ballSPACE · TAP · CLICK
PauseP
RestartR
MuteM

TOUCH IDLE
On phones: drag anywhere on the screen — the paddle tracks your finger with smoothing, portrait or landscape.

// COLLISION MODEL

FIND LEAST PENETRATION → PICK AXIS penY<penX → dy penX<penY → dx

// ENGINE NOTES

  1. Fixed timestep. Accumulator steps the sim at exactly 1/60 s, so behaviour is identical on 60 Hz and 120 Hz panels.
  2. One brick per frame. Overlaps are ranked by penetration; the shallowest is resolved and ejected fully, so the ball never tunnels or sticks.
  3. Speed is preserved. Paddle contact only redistributes vx/vy along a 66° arc, plus a little spin from paddle velocity.
  4. Anti-degenerate guard. If |vy| drops below 28% of speed after a bounce, it is re-clamped — no horizontal ping-pong.
  5. Resolution-aware backing store. The canvas is re-scaled to CSS size × DPR (capped at 2×) for crisp pixels without mobile fill-rate cost.