Skip to content

Add hidden fossils: persistent meta-collectibles - #5

Merged
cmalpass merged 1 commit into
mainfrom
cmalpass-potential-enigma
Aug 26, 2026
Merged

Add hidden fossils: persistent meta-collectibles#5
cmalpass merged 1 commit into
mainfrom
cmalpass-potential-enigma

Conversation

@cmalpass

Copy link
Copy Markdown
Owner

What

Adds hidden fossils — a persistent exploration reward that turns every hand-built level into a secret hunt.

  • src/fossil.ts — new Fossil entity: a bone with a warm unearthed glow, a heavy bob, a weathering crack and an occasional sparkle. 30×26 hitbox; no update() (matches the crystal/heart pickup pattern, animated by t).
  • 3 fossils per level (9 total) placed in level-data.ts on risky ledges, stepping stones over lava, and behind the Frostpeak gates. Daily levels have none (the field is optional; a -1 sentinel keeps ids stable).
  • Persistent codex in store.ts (tinyrex_fossils): the first discovery of each levelIdx:i id is recorded once and survives across runs; later runs re-collect the same fossil for 150 points again (CFG.score.fossil).
  • Game wiring (game.ts, player.ts, ctx.ts): pickup through the existing player-collision loop; a first-find shows a Fossil found! n/9 status, a NEW FOSSIL! floating text, a bigger burst and a small shake. The HUD gains a Fossils n/9 line with a bone glyph; the menu shows per-level fossil dots on the cards, a FOSSILS n/9 lifetime-stat, and a new quest row.
  • 'fossil' SFX in audio.ts (unearth thud + warm chime).

Why

Gives the game an exploration/replayability hook for almost zero new-engine cost — it reuses the crystal pickup pattern almost verbatim. It also seeds the payoff loop for the upcoming Rex skins (Mint unlocks via fossils).

Validation (local gate — CI is failing for pre-existing unrelated reasons)

  • npm run typecheck
  • npm test137/137 (was 123; +14: fossil entity/store/level-data integrity + game integration, incl. a real player-collision pickup and respawn re-collection) ✓
  • npm run build — single file 109.5 kB / 33.9 kB gzip ✓
  • npm run lint — clean ✓
  • Headless Playwright E2E (fresh profile): fresh state → 9 total / 0 found; fossil 0:0 and 0:1 collected via real physics and persisted to tinyrex_fossils; respawn resets collected flags so fossils are re-collectable; zero page errors. HUD + menu screenshots verified (bone-glyph HUD line, bright/dim dots on the level cards).

Temp E2E artifacts were deleted before lint.

- Fossil entity (src/fossil.ts): bone with warm unearthed glow, bob,
  sparkle; 30x26 hitbox, re-collectable each run for 150 points.
- 3 hidden fossils per hand-built level (9 total), placed on risky
  ledges, stepping stones and behind the frostpeak gates.
- Persistent codex (store.ts tinyrex_fossils): first discovery is
  recorded by id "levelIdx:i"; re-runs pay score again.
- Game wiring: pickup via player collision, first-find status +
  shake + NEW FOSSIL text, HUD line with bone glyph, menu fossil
  dots on level cards, lifetime stats line, quest panel row.
- Tests: fossil entity/store/level-data integrity + game
  integration (137 tests total); headless E2E verified.
@cmalpass
cmalpass merged commit 018217a into main Aug 26, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant