# dice_roll
The fat die leaving the hand: a quick rattle of chunky plastic tumbling over
the board, a couple of knocks as it bounces and a last tick as it settles.
Two seconds, which is the length of the die's tumble.
Played once on the `roll` bus event, as the die is thrown — before the pawn
walks.
# coin_gain
Coins arriving: two quick bright bell notes stepping upward, the classic
"you got something" chirp, over in about a second. Cheerful and small, so it
can fire several times a turn without wearing out.
Played on the `resolve` bus event when a seat's coin total went UP — a blue
tile, a green gift, a lucky double.
# lose
The ceremony, lost: the same fanfare's shape deflated — a sagging trombone
line that gives up at the end. Comic rather than cruel, since the winner is
still a toy.
Played on the `matchEnd` bus event when the match belongs to a CPU seat.
# win
The ceremony, won: a proper little victory fanfare — a rising call, a held
chord and a run of bells at the end — about a second long, sized to loop
under confetti if the ceremony lingers.
Played on the `matchEnd` bus event when seat 1 (P1, the human) takes the
match, including a shared win.
# hop
A toy pawn's step: one small springy cartoon boing with a light plastic tap
as it lands, dry and close, decaying inside three-quarters of a second so six
in a row read as someone waddling round the ring rather than as a tune.
Played once per tile walked, on the `moveStep` bus event, with the pitch
nudged at random so a long walk never sounds like one sample stuck on repeat.
Peak 0.22, which puts it in the same band as `grab` and `shop_chime`.
The first generation of this clip came back at peak 0.003 — about 51 dB below
every other effect and inaudible under the music at any volume the mixer
accepts — and was replaced.
# grab
One coin snatched in COIN CLASH: a tiny bright pluck with a short sparkle on
it. Deliberately the smallest cue in the set, because the arena can report
several grabs a second and this has to stay a texture rather than a melody.
Played on the `showdownScore` bus event, rate-limited to roughly ten a second
so four seats grabbing at once do not stack into noise.
# coin_loss
Coins leaving: a short descending "wah-wah" of a muted toy brass, the sound
of a good day turning sour. About a second, low enough not to be confused
with the coin pickup.
Played on the `resolve` bus event when a seat's coin total went DOWN — a red
tile, a green tax, or coins spent in the shop.
# game.rules — Origo Party's shared contract
The one module every slice of Origo Party reads. It holds no mutable state:
the Match component owns the live state table and publishes it as
`Rules.state`, and every other slice reads that and listens on `Rules.on`.
## Constants
`ROUNDS` (3), `START_COINS` (10), `STAR_COST` (20), `BLUE_COINS` (3),
`RED_COINS` (-3), `SHOWDOWN_SECONDS` (60), `SHOWDOWN_BONUS` (10), and
`PLAYERS` — the four seats with their colour, candy material and whether the
seat is human.
## The board
`BOARD_SIZE` (32) tiles around a superellipse `RADIUS_X` x `RADIUS_Z`.
- `tilePosition(index) -> x, y, z` — where tile `index` (1..32) sits.
- `tileFacing(index)` — the heading a pawn faces standing on it.
- `pawnPosition(index, seat)` — beside the tile, fanned by seat so four pawns
on one tile do not overlap.
- `spaceKindAt(index, round)` -> `"blue" | "red" | "green" | "shop" | "star"`.
The Star Space moves every round; `starIndexForRound(round)` names it.
- `SPACE_MATERIAL` / `SPACE_LABEL` — what each kind looks like and reads as.
## The rules
- `advance(from, spaces)` — the tile you land on, wrapping the loop.
- `resolveSpace(kind, player, rng)` -> `{ coins, stars, kind, note }`.
- `rankings(players)` — final order, stars first then coins.
- `newState(rounds)` — the shape the Match component owns.
## The bus
`Rules.on(event, fn)` returns an unsubscribe. `Rules.emit(event, payload)`.
A handler that throws is dropped and logged; it never takes the bus down.
Events: `title`, `roundStart`, `turnStart`, `roll`, `moveStep`, `arrive`,
`resolve`, `shop`, `starBought`, `roundEnd`, `showdownStart`, `showdownScore`,
`showdownEnd`, `matchEnd`, `hud`.
# shop_chime
The corner store's door: a soft two-tone bell chime, welcoming rather than
transactional. It plays as the stall opens its stock, before anybody has
decided to buy anything.
Played on the `shop` bus event.
# star_buy
Buying the Star: a rising three-note fanfare with a shimmer on top, a little
ceremony in one second. It is the only thing the match actually counts, so it
is the brightest cue in the set.
Played on the `starBought` bus event, whether the Star was paid for at the
pedestal or bought from the shop stock. The coin-loss cue is deliberately
suppressed on that beat so the 20-coin spend does not fight it.
# party_loop
The party bed: a bright, bouncy candy-toy tune — toy piano, marimba and a
light shuffled kit over a round bass — the sound of a board game that is
pleased with itself. Two minutes long, generated as a whole-clip loop, and
measured at `audio.loopSeam` at ratio 0.01 against its own ordinary sample
step, so it wraps without a click or a gap.
It plays under the whole match from the title screen to the ceremony on the
`music` mixer channel, at `musicVolume` (0.42) so the one-shots sit on top of
it rather than beside it.
# countdown
The COIN CLASH klaxon: a bright two-second alarm-turned-fanfare that says the
scramble is about to start — urgent, but still made of toys.
Played on the `showdownStart` bus event as the arena opens.