Skip to content

Dynamic weather per theme: frost gusts, lava geysers, pollen drift - #10

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

Dynamic weather per theme: frost gusts, lava geysers, pollen drift#10
cmalpass merged 1 commit into
mainfrom
cmalpass-potential-enigma

Conversation

@cmalpass

Copy link
Copy Markdown
Owner

Each theme now has gameplay-tied environmental dynamics (new src/weather.ts):

  • Frostpeak: timed wind gusts (every ~8 s) streak across the screen with a low whoosh and shove Rex sideways for a couple of seconds.
  • Volcanic: big lava pools grow geyser vents that bubble to telegraph, then erupt a 1.4 s hot column that damages Rex and kicks him out. Vents derive from level geometry (pools ≥ 180 px wide), capped at 5.
  • Crystal Valley: slow pollen motes drift around Rex with a subtle sway.

Forces use velocity blending so they survive the player's air drag. Reduced-motion mode suppresses the decorative particles but keeps the gust force and geyser damage. Weather updates during play and dying, draws in the foreground, and resets per level via buildLevel().

Validated locally (CI is failing for pre-existing unrelated reasons, so local validation is the gate):

  • npm run typecheck
  • npm test — 225/225 (was 209; +16 new: pure ventState/gusts/geysers/drift + game integration) ✓
  • npm run build — 135.93 kB / 41.81 kB gzip ✓
  • npm run lint
  • Headless Playwright E2E: gust fired + 106 streaks + player shoved −50 px in 0.7 s, geyser vent at x=2700 erupted (state=erupting, 21 particles) and burned Rex 3→2 hearts, 18 pollen motes, zero page errors ✓

Screenshots: /tmp/tinyrex-e2e/01-gust.png, 02-geyser.png, 03-pollen.png

Each theme now has gameplay-tied environmental dynamics (new src/weather.ts):
- Frostpeak: timed wind gusts (every ~8 s) streak across the screen,
  whoosh SFX, and shove Rex sideways (~55 px/s drift) for a couple of
  seconds.
- Volcanic: big lava pools grow geyser vents that bubble to telegraph,
  then erupt a 1.4 s hot column that damages Rex and kicks him out.
  Vents derive from level geometry (pools >= 180 px wide), capped at 5.
- Crystal Valley: slow pollen motes drift around Rex with a subtle sway.

Forces use velocity blending so they survive the player's air drag.
Reduced-motion mode suppresses the decorative particles but keeps the
gust force and geyser damage. Weather updates during play and dying,
draws in the foreground, and resets per level via buildLevel().

Validated: typecheck, 225/225 tests (+16 new: pure ventState/gusts/geysers/
drift + game integration), build (135.93 kB / 41.81 kB gzip), lint, and
headless E2E (gust shove -50px, geyser eruption burns Rex 3->2 hearts,
pollen present, zero page errors).
@cmalpass
cmalpass merged commit 9af9ddf into main Aug 27, 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