Breaker is a brick-breaker played inside an octagon: up to eight players, one paddle per wall, a shared field of bricks in the middle. To play it you need no math at all. To master it — or to build a bot that does — you need the law of the bounce, and that law is real geometry a twelve-year-old can hold in one hand.
1 · Walls are mirrors
A ball leaves a wall at the same angle it arrived — both angles measured from the perpendicular, not from the wall itself. (That's the classic mix-up; draw both and let the room vote.) In vector words: flip the part of the velocity going into the wall, keep the part sliding along it. That single sentence is the whole law of light reflection, and it's one line of code:
where n is the wall's unit normal (the perpendicular). Nothing else in the game moves the ball except this — between collisions it travels in a dead-straight line at constant speed, advanced in three small sub-steps each tick so it never tunnels through a thin wall. No calculus anywhere; it's all vectors and straight lines.
2 · The paddle is a mirror with a steering wheel
A paddle first obeys the mirror rule — then adds a bend that depends on where the ball landed, measured from the paddle's center:
offset = (landing spot − paddle center) ÷ half-width→ −1 at the left edge, 0 dead center, +1 at the right edge (the paddle is 120 px wide, so half-width is 60).- the mirrored ray is then rotated by
offset × 30°toward the side it hit. - a dead-center catch is a pure mirror bounce — zero bend.
This is the whole skill of the game: where you catch is where you send. And to aim, you run the rule backwards — pick the catch that produces the tilt you want:
Target on your right → catch the ball on your right half → it leaves angled right. That one inversion is the entire craft of aiming.
3 · The guard rail
Whatever the math says, the ball never leaves flatter than 70° from the perpendicular — so no bounce can skim uselessly along a wall forever. And every paddle save speeds the ball up 4% (it opens at 10 px/tick and caps at 16), which is why rounds always resolve instead of stalling. Speed, as we'll see, is also the secret to a huge score.
Bricks are circles — on purpose
Every brick is a circle (radius 22). That's a design choice, not decoration: a brick bounce is the exact same mirror rule, where the mirror is the tangent line at the point of contact — and the perpendicular is simply the line through the ball's center and the brick's center. One law explains everything on the screen. There's also an ownership rule worth knowing: the last paddle to touch a ball owns it — the ball wears that player's color and its brick hits pay that player. A fresh white ball from the center belongs to nobody and passes through bricks until someone earns it with a save.
The bricks sit in three rings — gold at radius 95, green at 155, blue at 215 — and the gaps line up on the center axis, so firing straight up threads every gap and hits nothing. You have to chip inward from the outside: blue → green → gold. Because each hit adds 4% speed, a ball loose in the dense gold core becomes a pinball — one entry, dozens of ricochets. In the engine's own trace, a single launch (paddle parked at x = 336, aimed 19° off vertical) ricochets 33 times and clears the gold core for 780 points from one shot. The counter-intuitive move: sometimes hold the paddle still, in the ball's return lane, so it keeps feeding the rich region.
Predicting a bounce: unfold the mirrors
The single most useful thing a strong bot computes is where will this ball be in N ticks, wall bounces included. The trick is the oldest one in optics: don't bend the path — unfold the wall. Reflect the whole board across the wall the ball is about to hit, and the bounced path becomes a straight line into the mirror-image board. Do it for each wall in turn and a zig-zag trajectory straightens into one ruler-line you can read off.
A bot that unfolds can aim three bounces deep; a bot that only reads the ball's current velocity is guessing one step ahead. That's the difference between the sample bots, which climb a clear ladder:
- follow — track the ball's x
- predict — unfold the walls
- aim — steer at the gold
follow.js just chases the ball's column. predict.js unfolds the mirrors to meet it. aim.js adds the inverse paddle rule to send it at the core. Each rung is a named, readable idea — not a wall of cleverness.
Here's the shape of what a bot is actually written against — every player sees its own wall as the bottom, so the law reads the same from every seat:
function nextMove(state) {
// Everything is in YOUR view: your paddle is at the bottom, x grows right.
// state.me = { x, y, width, speed } — your paddle center
// state.balls = [{ x, y, vx, vy }, ...] — incoming balls have vy > 0
// state.bricks = [{ x, y, r, points, color }]
// state.others = [{ x, y, width }, ...]
return 'LEFT'; // or 'RIGHT' | 'STAY' — it sticks until you change it
}
The numbers a bot is written against
These are the real tunables from the game's source of truth (constants.js) — the same values the server rules and the on-screen game both read, so they can never drift apart:
| Board | 720 × 720 box; octagon walls sit ~336 px from the center; each wall ≈ 278 px, stepping by 45° |
| Paddle | 120 wide × 14 thick; slides 11 px/tick along its wall |
| Ball | radius 10; launches at 10 px/tick, ×1.04 per save, capped at 16; moves in 3 sub-steps/tick |
| Aim bend | up to ±30°; outgoing angle clamped to 70° from the perpendicular |
| Bricks | radius 22, in rings — gold @95 (×8, 50 pts) · green @155 (×16, 20 pts) · blue @215 (×24, 10 pts) |
| Round | ends when bricks or balls run out, or at 3000 ticks; highest score wins |
The exercise: explain the rule to your AI
Here's why this game is really an AI-literacy lesson in disguise. Each student opens their AI partner and explains the bounce law in their own words, then asks it to write a bot. The bots meet in a Breaker tournament; then students refine the explanation and rematch. The whole point lands fast: a vague description produces a weak bot, and a precise one produces a champion. The child's job is not to be the programmer — it's to be the person who can state a rule precisely enough to command a powerful tool, which is exactly the skill the whole arcade is built to grow.
A strong explanation hits all five points. It's a genuinely useful rubric for "did you understand the geometry?":
- angles are measured from the perpendicular, not the wall
- the paddle bend is judged from the paddle's center, over the half-width (−1 … +1)
- the bend is offset × 30°, and dead center means no bend
- the outgoing angle is clamped to 70°
- the numbers: paddle 120 wide & 11 fast, ball up to 16 fast, gold bricks (50 pts) in the middle
And the closing fact worth the whole chalk talk: rotate a mirror by θ and the reflection turns by 2θ. So our ±30° bend is exactly a paddle whose surface curves 15° from center to edge — the paddle is secretly a gently curved mirror. Same reason your face stretches in the back of a spoon. Bring a spoon.
State the law, then test it
Play a few rounds of Breaker in The Glitch Arcade, then try the exercise at home: say the bounce rule out loud in one precise sentence, and check it against the five-point list above. If you can say where a right-half catch sends the ball and why, you've got the geometry.
Open the Arcade — free Read: games as laboratories