AABB + closest point
The ball is tested as a circle against every alive block using a clamped nearest-point distance, so corners register honestly instead of in a square halo.
Canvas Arcade // Cab-01 // Vanilla JS // 60 FPS
8 × 4 grid · 32 blocks · 3 balls · 320 max
Score
Balls remaining
Streak
The ball is tested as a circle against every alive block using a clamped nearest-point distance, so corners register honestly instead of in a square halo.
Overlap on X is compared against overlap on Y. The shallower axis is the one the ball just crossed — flip dy on a shallow Y overlap, dx on a shallow X overlap.
Only the nearest candidate resolves per sub-step, the ball is pushed out along the resolved axis, and speed is renormalised — no tunnelling, no block chaining, no stuck ball.
Contact offset −1…+1 maps to a −60°…+60° exit vector, plus a slice of paddle velocity for spin. Hitting the paddle's side faces mirrors dx instead.
| Field | 400 × 600 |
|---|---|
| Grid | 8 × 4 · 50 × 20 |
| Paddle | 60 × 10 @ y580 |
| Paddle clamp | 0 – 340 |
| Ball radius | 3 |
| Launch vector | 2, −2.8 |
| Speed band | 3.44 → 4.00 |
| Block value | +10 |
| Lives | 3 |