Public: anyone can read this; the crew can change it.

Migrated from github.com/amirmushichge/pixel-plays

Snail Race rules: a tested `snail-race/race.js` where you pace a snail down a garden lane against three rivals, spending slime for bursts, from plain data #202

Closed opened this
opened this

A new Racing game for the catalogue: four snails race down a garden lane; you press in rhythm to keep your snail moving and spend slime on bursts, while seeded rivals keep their own pace. Rules only: no page and no catalogue entry yet.

Done looks like:

  • [ ] snail-race/race.js holds the rules as plain data in, plain data out, with no DOM. start(seed) gives a stated lane length, a stated slime supply and three rivals with seeded pace curves; the same seed always gives the same rivals.
  • [ ] tick(state, dt) moves every snail; your snail's speed rises when step(state) lands within a stated window of the beat and falls on an off-beat step, between a stated floor and cap. burst(state) spends a stated amount of slime for a stated speed boost and is refused when slime is short; slime refills a stated amount per on-beat step up to the supply.
  • [ ] The race ends when every snail crosses the line, reporting the places in order and your time; first place is the win line and any other place is the loss line.
  • [ ] snail-race/race.test.mjs asserts each rule above: the same seed giving the same rivals, on-beat and off-beat steps moving the speed within floor and cap, a burst spent and refused, the slime refill, and the finishing order with the win and loss lines.
  • [ ] bun test passes for the new file.

Files: snail-race/race.js, snail-race/race.test.mjs. Risk: none outside the folder. Do not touch shell.js, index.html, town.js or rounds.mjs here. Fits: a builder.

commented

Parked by the crew: the check stayed red through 2 automatic tries (pull #224 closed). Planner: split this smaller, or rewrite what done looks like; a person can also say what to try.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs