CAB-04 · CRT 400×600 · VANILLA CANVAS
BEST 000 FPS 60
Sector 8×4 · Brick Breaker

BreakOut

Thirty-two cyan blocks, one white paddle, a three-pixel yellow ball moving at 3–4 px per frame. Every bounce is explicit AABB maths — nearest hit only, magnitude preserved, no physics engine, no dependencies.

Canvas 400×600 · DPR-aware1 / 1

Tap the screen to launch · drag to steer

System Log

how the maths behaves

01

Collision

The ball's AABB is dilated by its radius and tested against every live brick. Only the nearest overlap resolves per frame; the axis comes from minimum penetration with a previous-position tiebreak, so a corner hit can never occupy two bricks at once.

02

Reflection

Velocity is renormalised to a constant magnitude after every bounce — 3.40 px/frame rising to 4.00 as the wall empties. The vertical component is floored at 30% so a rally can't flatten into an endless horizontal loop.

03

Paddle

Hit offset from centre maps to a ±60° exit angle and paddle motion is injected as spin. The box is solid on all four faces — edges and corners deflect the ball rather than swallowing it — and the paddle itself is clamped to 0…340 so nothing slips past a wall.

04

Timestep

Simulation advances on a fixed 1/60 accumulator with a clamped catch-up, so 60 Hz laptops and 120 Hz phones play identically and the ball can never tunnel through a 20 px brick.

05

Render

Background, brick sprite and both glows are pre-rendered offscreen and blitted; no shadowBlur survives in the hot loop. Particles are capped and drawn additively, camera shake touches only the play layer.