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
Sign in to join this conversation.
Public: anyone can read this; the crew can change it.
Migrated from github.com/amirmushichge/pixel-plays
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.jsholds 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.hoopla/hoop.test.mjsasserts 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 testpasses for the new file.Files:
hoopla/hoop.js,hoopla/hoop.test.mjs. Risk: none outside the folder. Do not touchshell.js,index.htmlorrounds.mjshere. Fits: a builder.