Color Match Grid Rules Straight from the Engine

In Color Match the falling ball needs zero aiming. It drops along the vertical center line of the wheel and always strikes the top entry point, marked by the white indicator. The only question is which sector of the wheel grid sits under that marker at the moment of contact, and the engine turns that question into pure timing.

How the wheel grid is built

The wheel starts as a four sector grid with a fixed color order. Sector sizes divide a full turn evenly, so four sectors measure 90 degrees each. Colors fill by index modulo 4, which yields red, blue, yellow, green around the circle from the colors array in the source. The order never shuffles during a run. Only the rotation angle changes.

The engine reads the winning sector by comparing the contact angle against the current wheel rotation at the instant the ball touches the rim. A mismatch against the ball color ends the run immediately with a 0.4 second screen shake and a 12 pixel displacement.

The drop is a fixed clock you can time against

The ball waits at y 100 until you tap, then falls from rest under gravity 1200. Contact happens when the distance from the wheel center reaches 148 pixels, the sum of wheel radius 130 and ball radius 18. The fall covers 280 pixels.

That fall takes 0.683 seconds, computed as the square root of 2 times 280 over 1200, and it never varies. The ball has no horizontal motion and no air drag. Your entire read window is therefore a fixed clock, and the wheel advance during that clock is the spin speed times 0.683.

At the opening spin of 1.2 radians per second the wheel advances 0.82 radians during the fall, which is 47 degrees. That is almost exactly half of a 90 degree sector. Release when the matching color sits half a sector short of the entry marker, measured against the direction of rotation, and the sector lands under the ball.

Grid growth changes your target width

The section grid grows twice, and both steps change the geometry you aim at.

At score 10 the wheel rebuilds with 6 sectors of 60 degrees. The fill rule i modulo 4 produces the sequence red, blue, yellow, green, red, blue. Red and blue now cover 120 degrees each while yellow and green cover 60 each. The ball color rolls uniformly from all four, so between scores 10 and 19 a red or blue ball is twice as forgiving as the other two.

At score 20 the wheel rebuilds with 8 sectors of 45 degrees, and every color covers exactly 90 degrees of the circle. From that point the grid is symmetric and memorization of the color order matters more than width.

The sector layout then freezes. No code path changes it again for the rest of the run.

The spin schedule you must lead by

Spin rises 0.15 radians per second at every fifth point and caps at 6.0, reached at score 160. The HUD prints your level as floor of score over 5 plus 1, and a small bar shows the spin fraction from green to red.

Compute your lead angle as spin times 0.683 seconds times 57.3 degrees per radian. The schedule below gives the results.

  • Score 0, spin 1.2, lead 47 degrees, half a starting sector.
  • Score 40, spin 2.4, lead 94 degrees, just over one starting sector.
  • Score 80, spin 3.6, lead 141 degrees.
  • Score 120, spin 4.8, lead 188 degrees.
  • Score 160 and beyond, spin 6.0, lead 235 degrees, over five 45 degree sectors.

Follow these unconditional steps each drop.

1. Read the ball color and find every matching sector on the wheel.

2. Multiply the current spin by 0.683 to get the lead in radians, then by 57.3 for degrees.

3. Pick the matching sector that will rotate into the entry marker after that lead.

4. Tap when that sector sits the lead angle before the marker against the rotation direction.

5. After every fifth point, redo the arithmetic before the next drop, because the spin stepped up.

Where this implementation hurts you

One wrong contact ends the run. There is no grace bounce and no second ball, and the engine saves your high score at the instant of failure.

The combo counter is cosmetic. It raises the particle burst from 20 plus 3 per combo step and prints a growing x number, but no code path multiplies score by it. Chasing combo visuals buys nothing.

The fall off screen game over check can never trigger. The ball falls along the wheel center line and always contacts the rim first, so that branch is dead code. Harmless, but worth knowing when you read failure reasons off the screen.

Both the ball and the wheel integrate from the same clamped dt, so the 0.683 second clock holds even on stuttering frames. Wall clock time stretches, yet the lead arithmetic stays valid because the wheel advance and the fall slow together.

Your record persists under the localStorage key colorMatch_highScore. Clearing site data for the domain erases it, and the engine stores nothing server side.

Pre drop checklist

  • [ ] Ball color identified and all matching sectors located.
  • [ ] Lead angle computed from the current spin and 0.683 seconds.
  • [ ] Level up arithmetic redone after every fifth point.
  • [ ] Six sector wheel treated as uneven, with red and blue as wide targets.
  • [ ] Entry marker, meaning the white indicator at the top, used as the only reference point.

Play [Color Match](/en/color-match) with a stopwatch on the fall to verify the 0.683 second clock. If your measured lead angles disagree with the schedule above, or you hit a failure that the wheel math does not explain, send the score, the spin level, and the sector you aimed at. Mismatch reports with numbers are the fastest way to correct this page.