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

Migrated from github.com/amirmushichge/pixel-plays

Hoopla Stall rules: a tested `hoopla/hoop.js` that plays a whole game from plain data #134

shipped production is serving it opened this has it
opened this

A new Throwing game for the catalogue: toss wooden rings over prize blocks on a fairground stall. Rules only: no page and no catalogue entry yet.

Done looks like:

  • [ ] hoopla/hoop.js holds the rules as plain data in, plain data out, with no DOM. Nine prize blocks stand on a stepped table in a seeded layout. A toss is an aim and a power. The ring lands at a point set by both. It scores only when it settles fully over a block, meaning the block fits inside the ring with a stated clearance. A ring that touches a block's edge bounces off and scores nothing. Blocks further back are worth more. One game is eight rings.
  • [ ] The end reports the total score and the best, with a win line at or above a stated target and a loss line below it.
  • [ ] hoopla/hoop.test.mjs asserts each rule above: the aim and power to landing relation, a ring fully over a block scoring, an edge touch bouncing off, row values, eight rings ending the game, the same seed giving the same layout, and the win and loss lines at the target.
  • [ ] bun test passes for the new file.

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

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs