# One-button ring ## What this builds A ring travels around a circle. The person holds one button or key to ride it, and releases in a narrow window at a marked target. A good release scores a point and slightly speeds the next lap. A miss ends the run. There is almost no other UI. This is an original timing game. Read `spekkr.inputs.json` first. `title` sits under the ring. `window` is the allowed error at the target, in milliseconds. `pace` sets the first lap's period. `pulse` and `sound` add feel; tests may mock sound. ## Out of scope - Multiplayer or a recorded soundtrack. - Network or a global scoreboard in the checks. - A second control. There is one button. ## Requirements Each requirement has an id. Checks name the id they cover. ### R1. The clock - All timing uses a clock the tests can replace. The production clock is `performance.now`. - A lap's period starts at 2.4 s, 1.6 s or 1.0 s according to `pace`. Each good release multiplies the next period by 0.97, never below 0.48 s. - The target sits at angle 0. The rider's angle is 2π * (elapsed / period) from the start of the lap, starting at π (the opposite side). Accept when: with a fake clock, the angle at t = 0, a quarter period, and a half period matches the table in `design.md` within 0.1 degrees. ### R2. Hold, release, miss - A hold starts a lap if one is not already running. A release is good when the absolute time error to the target is less than or equal to `window` milliseconds. - A good release adds 1 to the score and starts the next lap at the new period. - A release outside the window, or a hold that lasts more than one full period without a release, is a miss and ends the run. The last score stands. Accept when: the fake-clock cases in `design.md` cover a good release, a late miss, an early miss, and a held-too-long miss, with the stated scores. ### R3. Picture - The ring is a 240 px radius stroke on a 1600 by 1000 frame, centred. - One golden screenshot is taken at rest before the first hold (`idle-ring`). Three more frames (held, good-release, miss) are optional but shipped and checked. Accept when: the four frames match the goldens within the tolerance in `design.md`. ### R4. Files - One command runs the fake-clock tests and writes the screenshots. Sound is mocked. No network. Accept when: the command passes at every pace and at `window` 40 and 160. ### R5. Inputs - The build reads `spekkr.inputs.json`. Settings label the UI, options turn features on or off, and a swap must be one of its choices. - A value outside a stated range, or a swap that is not one of its choices, is refused before the app starts its checks, with a message that names the key. Accept when: the default inputs render, an illegal swap is refused by name, and changing a visible setting (for example the title) shows up in a later check. ## Verification Timing-window tests use a fake clock, never the wall clock. They cover a good release, both edges of the window, early and late misses, and a hold that lasts a full period. The score after each case matches the table. Four golden screenshots are checked, including one at rest. Audio is mocked. ## Definition of done - Every acceptance check above runs from one command, and all pass at the person's inputs. - A README says how to play, how to run the checks, and how to change the window.