CAB-04 · ONLINE READY 400 × 600 · CANVAS 2D

Cabinet 04 · brick breaker · vanilla canvas BREAK/OUT

32 blocks. One 3-pixel ball. 3 lives, no mercy — and a paddle that bends every shot based on exactly where you caught it.

60 fps fixed step touch drag swept aabb 0 deps

Drag anywhere on the screen · tap to launch · arrows + space on desktop

Under the glass

Small rules.
Sharp edges.

No engine, no libraries — one 400×600 bitmap, one requestAnimationFrame loop, and a handful of if-statements doing all of the physics work.

  1. 01

    Fixed timestep

    Accumulator steps the sim at exactly 1/60 s regardless of a 60 Hz or 120 Hz panel, so a fast phone never plays the ball faster than a slow one.

  2. 02

    Axis-resolved AABB

    The ball's bounding box is tested against every live block. Smallest penetration depth decides the axis: shallow on X flips dx, shallow on Y flips dy — the block is pushed out, never re-hit.

  3. 03

    Paddle angle mapping

    Contact offset −1 → +1 across the 60 px face maps to ±60°. Dead centre is a near-vertical return, the corners fire wide, and a vertical floor stops flat rallies.

  4. 04

    Constant magnitude

    Velocity is renormalised after every bounce. Speed eases from 3.0 to 4.0 px/frame as the wall thins — it gains pace, never weight.

  5. 05

    One hit per frame

    Two sub-steps of collision per tick; only the nearest overlapping block resolves, so the ball never punches a straight hole through a row.