Public: anyone can read this; the crew can change it.
Migrated from github.com/amirmushichge/pixel-plays
Sack Race rules: a tested `sack-race/course.js` where you hop a sack down a grass lane in time with your own landing, against three seeded rivals, from plain data, in a two-file pull with a test file that runs in under a second #307
Reviewed pull #322 at its head: ticked step(state) advances one tick: rivals move by their rhythm, the player's hop arc rises and lands, and a missed window counts a wobble. hop(state) presses, and returns a full stride inside the window, a short shuffle when early, nothing while toppled or in the air, and refuses a press after the race is over, with a reason and the same state. Three wobbles in a row topple the player for the stated pause, then reset.; The race ends when every runner crosses the line or a stated tick limit is reached. The end line reports the player's place out of four and their finishing tick, and a tie at the line goes to the runner who crossed on the earlier tick, then to lane order.; sack-race/course.test.mjs asserts each rule above: the same seed giving the same rivals and the same race, a full stride, a shuffle, a press in the air doing nothing, a wobble, the topple and its pause and reset, the refusal after the end, the tick limit, and the first, last and tie-break place lines.; bun test passes for the new file.; sack-race/course.test.mjs loads no page and starts no renderer or server: it calls the rules module directly and runs in under one second on its own (bun test sack-race/course.test.mjs). The pull states the measured time.; If the check fails only on "test took longer than 600s" or a CPU limit, the pull says so. Do not cut the rules or their tests to get under the limit..
Left open after pull #322 landed: 1 unticked item remains (sack-race/course.js holds the rules as plain data in, plain data out, with no DOM. start(seed) gives the lane length, the timing window in ticks, and three rivals each with a seeded stride and rhythm within stated ranges. Randomness comes only from the seed, so the same seed and inputs give the same race; no timers and no Math.random.). The planner files each as its own issue and closes this one; a person may close it, tick what is done, or say what is left. Until then the crew does not pick it again.
Already done on main in f318f9d: sack-race/course.js is plain data in, plain data out, with no DOM, timers or Math.random. start(seed) gives lane (40), window ([2, 5] ticks) and three rivals. Each rival's stride falls in the stated RIVAL_STRIDE_MIN..RIVAL_STRIDE_MAX range and its rhythm in RIVAL_RHYTHM_MIN..RIVAL_RHYTHM_MAX, both drawn from a seeded mulberry32 step. The tests 'start: stated lane and window, three rivals within stated ranges, same seed same rivals' and 'the same seed and inputs give the same race' in sack-race/course.test.mjs assert it, and the file passes 14 of 14 in 29 ms. Closed as no longer wanted: the box has shipped, so a fresh issue would only ask a builder to redo it.
A new Racing game for the catalogue. You stand in a sack on a fête lane of stated length. Each hop is a press; a press timed inside a window just after you land carries you a full stride, an early press is a short shuffle, and a press too long after landing lets you wobble, and three wobbles in a row topple you for a stated pause. Three rivals hop by a seeded rhythm. Rules only: no page and no catalogue entry yet.
Done looks like:
sack-race/course.jsholds the rules as plain data in, plain data out, with no DOM.start(seed)gives the lane length, the timing window in ticks, and three rivals each with a seeded stride and rhythm within stated ranges. Randomness comes only from the seed, so the same seed and inputs give the same race; no timers and no Math.random.step(state)advances one tick: rivals move by their rhythm, the player's hop arc rises and lands, and a missed window counts a wobble.hop(state)presses, and returns a full stride inside the window, a short shuffle when early, nothing while toppled or in the air, and refuses a press after the race is over, with a reason and the same state. Three wobbles in a row topple the player for the stated pause, then reset.sack-race/course.test.mjsasserts each rule above: the same seed giving the same rivals and the same race, a full stride, a shuffle, a press in the air doing nothing, a wobble, the topple and its pause and reset, the refusal after the end, the tick limit, and the first, last and tie-break place lines.bun testpasses for the new file.sack-race/course.test.mjsloads no page and starts no renderer or server: it calls the rules module directly and runs in under one second on its own (bun test sack-race/course.test.mjs). The pull states the measured time.Files:
sack-race/course.js,sack-race/course.test.mjs: a two-file pull. Risk: none outside the folder. Do not touchshell.js,index.html,town.js,rounds.mjs,forge.json,scripts/,playtest.test.mjsorserve.test.mjshere. Fits: a builder.