Arcade Unit 04 · Vanilla Canvas · No Libraries

Cabinet online · HTML5 / Canvas 2D

Break//Out

32 blocks. Three balls. A 3px ball at 3.44px/frame. Clear the grid — don't kiss the floor.

Field 400×600 Grid 8×4 FPS 60 State ready

Score +10 / brick

$000

CREDITS · MAX 320

Balls LIVES

BEST 0

Grid integrity 32 / 32

Cleared 0Streak 0

Telemetry

ball.x200.0
ball.y570.0
velocity0.00 / 0.00
|speed|3.43
hits / subs0 / 3
400 × 600

Insert credit

Clear the grid

Eight columns, four rows. Drag the field (or thumbs) to slide the paddle.

SPACE LAUNCHES · P PAUSES · R RESTARTS

Ball drained

Game Over

FINAL SCORE 0 · BRICKS 0/32

HIGHEST ROLLOVER STREAK: 0

Grid demolished

You Won!

SCORE 320 / 320 · TIME 00:00

PERFECT SWEEP LOGGED

Standby

Paused

P TO TOGGLE

◀
▶

Drag the field to steer · tap to launch

Control map

←→ slide paddle
AD alt slide
SPACE launch / hold ball
P pause
R restart
DRAG finger / mouse steer

System

Fixed-step integration with 1.5px substeps keeps a 3.4px/frame ball from tunnelling through 20px bricks. One collision resolved per substep — no double flips.

Physics notes

launch vectordx 2.0 · dy −2.8
|v| clamp3.43 → 4.00
max paddle angle±72°
min |dy|0.90
paddle travelx 0 → 340

Operation Manual

Rev 1.0 · single file · zero dependencies

The field

Eight columns of 50px bricks, four rows of 20px, stacked flush along the top of a 400×600 field. A reserved band at the very top carries the in-canvas HUD: score top-left, remaining balls top-right, drawn in the same canvas pass as the playfield.

Reflection

Walls flip one axis. Bricks flip the axis of least penetration — hit a face, flip dy; clip a flank, flip dx. The paddle always returns the ball upward, but the exit angle tracks where it landed and how fast the paddle was travelling.

Anti-stick rules

Every collision ejects the ball fully outside the box it just hit and renormalises the velocity, so the magnitude never drifts and a ball can never get swallowed by a brick seam. A flat-trajectory clamp forces a vertical component.

Collision core

circle → AABB, resolved with minimum translation vector

  penX = (r + w/2) - |ball.x - box.cx|      penY = (r + h/2) - |ball.y - box.cy|
  if (penX < 0 || penY < 0) continue;              // no overlap
  axis = (penX < penY) ? 'x' : 'y';                // shallowest = contact face
  keep the candidate with the deepest contact      // one brick per substep
  ball[axis] += sign(v[axis]) * (pen + 0.5);        // eject, then reflect
  v[axis] = sign(v[axis]) * |v[axis]|;

Personal best

0

Score persists locally between sessions. Every brick is worth exactly 10 — a clean sweep is 320, no multipliers.