Skip to main content

Module state

Module state 

Source

Structs§

EdgeUnlockAnim
In-flight “path lights up” animation when a buy lights an edge. Lives only at runtime — #[serde(skip)]-projected fields don’t ever reach disk.
FingererState
Per-fingerer persistent state.
GameState
Persistent game state. Catalog-addressed state (fingerers_state, 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 Powerup. 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
Global, click-side buffs. Per-fingerer multipliers (the old Buff::FingererBoost) live on the modifier system in crate::game::modifier; only buffs that affect global click power belong here.
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.
EDGE_UNLOCK_CELLS_PER_TICK
Cells the edge-unlock wavefront advances per tick. At TICK_HZ = 20 a value of 2 = 40 cells / sec — a typical 8-cell straight edge fully energizes in ~0.2 s, a longer diagonal in ~0.4 s. Bumping this is the right knob when the user says “make it faster”; going below 1 (e.g. tick / 2 cells/tick = slower) needs a different mechanism since we sample integer cells per tick.
GREEN_COIN_ADD_PERCENT
Permanent AddPercent the Green Coin attaches on catch. Tunable; bumping it changes the long-term power curve significantly so treat with care.
GREEN_COIN_FLASH_TICKS
Green Coin catch pulse — slightly shorter than Lucky’s so the celebratory blip lands without lingering for so long it competes with whatever might be running on top (Frenzy, Buff, Lucky).
GREEN_COIN_ROW_FLASH_TICKS
Per-row gold shimmer on the targeted fingerer’s sidebar row when a Green Coin catch lands on it. ~2 seconds — long enough for the eye to track from the floating +10% {fingerer} particle over to the row, short enough that it doesn’t outlive the catch event.
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.
TREE_REFUND_FRACTION
Fraction of a tree node’s original cost returned on refund. The remaining fraction is the “exploration tax” — without this gap, buy/refund is a zero-cost move and the player can spam every combination for free. 0.70 = 30% loss on each refund, enough to make reckless paths expensive without punishing genuine course corrections.
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).