BRICK//BREAK

HTML5 CANVAS · RAF— FPS
Stage 01 · CRT 400×600 playing
tap field to launch
01

Collision ledger

Explicit AABB · one resolution per frame

01

Walls

Circle–edge test at x±3 and y±3. The axis component flips, the other is untouched, and the ball is snapped flush to the wall so it can't buzz inside the border.

02

Paddle

Offset from centre, normalised to ±1, maps to an exit angle of up to ±60°. Edge hits skid sideways, dead centre returns vertical. Paddle motion adds a touch of english.

03

Bricks

Every overlap is scanned; the closest brick wins and the rest wait for the next frame. The deeper penetration axis decides whether dx or dy flips, then the ball is pushed clear of the cell.

04

Missed

Below y = 600 costs a life. Ball respawns centred on the paddle at (200, 570) with a fresh launch angle. Three misses and the run is over — 320 is the ceiling.

400×600field
50×20brick cell
3.44→3.96speed px/f
60×10paddle @ y580
r 3ball
320max score