Arcade cabinet / canvas build 01
60 fps

HTML5 Canvas · zero dependencies

Break/Out

32 cyan blocks. One yellow ball. Three lives. Read the angle off the paddle, chain your streak, and clear the board before the floor wins.

  • 400 × 600 field
  • 8 × 4 grid
  • 50 × 20 bricks
  • AABB collision
  • Fixed 60 Hz step
  • Touch drag
  • Max 320 pts
power ready 400×600 · 2:3

Field manual

How the ball thinks

  1. 01

    Launch with intent

    The ball rides the paddle until you commit. A dashed guide previews the first vector — it leaves at 2 / −2.8, never straight up.

  2. 02

    Steer with the paddle edge

    Hit right of centre, the ball leaves right. Contact near the tip opens the angle to roughly 65°, and a moving paddle adds spin on top.

  3. 03

    Chain a streak

    Every brick cleared before the paddle is touched raises the streak and the blip pitch. Touching the paddle resets it to zero.

  4. 04

    Watch the pace

    The magnitude is renormalised after every bounce — it never drifts. Every 8 bricks it creeps up, capped at 4 px per frame.

Collision tableAABB
wallside overlap → flip vx
ceilingy < r → vy = |vy|
paddlev = (sin θ, −cos θ) · speed
brick ↕smallest overlap → flip vy
brick ↔smallest overlap → flip vx
floory − r > 600 → lives − 1
frameclosest hit only, push out, 2 substeps