Skip to main content

Module state

Module state 

Source

Structs§

GameState
Persistent game state. Catalog-addressed state (fingerers_owned, upgrades_earned, achievements_earned) is keyed by STABLE STRING IDS, not positional indices, so reordering / inserting / removing entries in FINGERERS, UPGRADES, or ACHIEVEMENTS never corrupts an old save. Unknown ids in a save are ignored (forward-compat); missing ids default to zero / absent (backward-compat).
MisclickParticle
Screen-anchored particle (raw col/row, not biscuit-fractional). Used for misclick acknowledgement: a small grey “·” at the exact dead-zone click point so the player knows the click registered but missed every target.
Particle
Position is stored as a fraction of the biscuit rect ([0.0, 1.0] on each axis), matching GoldenCuque. The renderer resolves these fractions against the current biscuit rect every frame, so particles travel with the biscuit when the terminal resizes or the user zooms.

Enums§

Buff
ParticleKind
Visual flavor for a particle. Drives color/weight in the renderer; the motion model (rise + horizontal drift) is identical across kinds.

Constants§

ACHIEVEMENT_FLASH_TICKS
Achievement-unlock border channel duration (gold pulse like Lucky but shorter — celebratory, not lingering).
CLENCH_SQUASH_TICKS
First CLENCH_SQUASH_TICKS of a clench draw the biscuit one row shorter (top blank dropped, art shifted) so each finger reads as a real squish before springing back. Strict subset of CLENCH_TICKS.
CLENCH_TICKS
How long the biscuit stays “clenched” (eye→*, color shifts pink, art vertically squashes by one row). Bumped from 3 to 6 so a single click is actually visible — at 20Hz, 3 ticks (~150ms) was hard to perceive.
HUD_FLASH_TICKS
HUD digit “I just got bigger” green flash duration.
LUCKY_FLASH_TICKS
MISCLICK_LIFE
Misclick “·” lifetime — short, just enough to acknowledge the attempt.
PURCHASE_FLASH_TICKS
TICK_DT
TICK_HZ
TOAST_TICKS
Achievement-unlock toast: how long the popup stays on screen.
UNLOCK_FLASH_TICKS
“You can afford this now!” row flash — fires the moment a fingerer or upgrade transitions from unaffordable to affordable. Brief on purpose: short enough that it’s clearly an “announcement,” not the longer purchase flash that fires on actual buy.

Functions§

biscuit_frac_to_screen
Convert biscuit-fractional coordinates back to an absolute screen point.
screen_to_biscuit_frac
Convert an absolute (col, row) screen point into biscuit-fractional coordinates, clamped to [0.0, 1.0]. Used at click/spawn sites that come from screen-space input (mouse clicks, RNG within the biscuit rect).