Walls
Left and right flip dx, ceiling flips dy. Position is clamped to the lane on contact so the ball can never tunnel into the border and repeat-fire.
Cabinet #0400 · Coin-op · 1 Player · HTML5 Canvas
Four explicit resolution rules. No physics engine, no broadphase — just AABB overlap tests, a push-out along the shallowest axis, and a velocity renormalisation every sub-step.
Left and right flip dx, ceiling flips dy. Position is clamped to the lane on contact so the ball can never tunnel into the border and repeat-fire.
Contact offset rel = (ball.x − paddle.mid) / 30 drives a deflection up to ±60°. Paddle velocity adds english; side hits flip dx instead, so the 60px bar behaves like a full-width block.
All 32 cells are tested, but only the shallowest penetration resolves per sub-step. The entry axis is inferred from the previous position, falling back to the smaller overlap. The ball is pushed clear of the cell — nothing lodges, magnitude is preserved.
Nothing lives below y > 600. A burn is logged, streak resets, the ball re-docks at the paddle centre (200, 570) and waits for a fresh serve at a randomised angle.
| Parameter | Value |
|---|---|
| Canvas | 400 × 600 |
| Brick grid | 8 × 4 |
| Brick cell | 50 × 20 |
| Brick origin | col·50, row·20 |
| Paddle | 60 × 10 @ y 580 |
| Paddle travel | 0 – 340 |
| Ball radius | 3 px |
| Ball origin | 200, 570 |
| Speed band | 3.44 – 4.00 |
| Lives | 3 |
| Per brick | +10 |
| Max score | 320 |
| Sub-steps / frame | 2 |