Commit Graph

4 Commits

Author SHA1 Message Date
Brian Fertig b4b656f6e4 Add asteroid mining: energy arm, beam FX, and context menu
- Click a rock to open a world-anchored mining popup (Mine/Stop/Cancel)
- Mining state machine locks the ship during the ~1.5 s arm extension, then fires an animated beam with ore motes, shock rings, sparks, and periodic surges
- ESC breaks the beam or closes the menu; outside clicks dismiss without flying
- Generalize the top-center console toast so discovery, tether, and mining calls share one slot
- Add a "mining" SFX entry (system-scan.mp3) and update preload/test to cover all configured sounds
- Ship a headless browser test (dev/mining-test.*) that drives the full arm sequence through the real input pipeline
2026-09-04 17:09:16 -06:00
Brian Fertig 217ba6bedb Add save/load system with 10-slot localStorage bank and UI
- SaveManager: 10-slot localStorage bank (put/get/clear/list/export), corrupt-bank recovery, failed-write surfacing, bulk JSON export
- SaveData: captureState / prepareLoad / consumeRestore / resetRunState — seed + player state round-trip through a shared registry
- MenuSubBar: fold-up drawer off the deck's MENU button (Save Game / Load Game / Return to Main Menu) with animated open/close
- SavePanel: 10-slot pop-up in save or load mode; overwrite + load confirm dialogs; "download all" bulk export; toast feedback
- ConfirmOverlay: split-open confirm dialog for destructive actions
- SlotCard, Toast: per-slot cards and inline feedback strips
- MenuScene: Load Game button (grayed while bank is empty) opens the same panel in load mode
- GameScene: menu sub-bar + save panel wired into deck action, ESC handling, input blocking while modal, applyRestore on scene boot
- Tether HUD moved from above the MENU button to upper-right corner, stacking downward
- MenuButton: disabled (grayed) state and screenFixed option for scrolling-camera UI
- New SFX assets (ui-click, ui-hover) + updated existing FX; gasgiant planet image
- Dev tooling: cdp-firefox.mjs, wdshot.mjs (headless Firefox via geckodriver), saves-ui-test.html/.mjs (integration driver), saves.test.mjs (Node unit tests), system-hud test updates
2026-09-04 13:09:08 -06:00
Brian Fertig 2d1265d592 Add SFX, dossier toggle/auto-fold, and tether HUD repositioning
- Add sound effects (construct, deconstruct, discovery) with config in data/sfx.json; play on dossier arrival/fold and new-object discovery; silently no-op when disabled or asset missing
- Rework the system dossier into a full lifecycle: open-by-default on arrival, one-shot auto-fold at 10 s, click-to-toggle (name + caret), reverse deconstruction order, state caret that swings with the open/closed state
- Add ScrambleDecode `reverse` mode so lines can deconstruct (value → static → '') for the fold animation
- Reposition the tether readout to bottom-right above the deck's MENU button, right-aligned and bottom-anchored; fall back to left column when the deck is disabled
- Expand decode and system-hud tests to cover reverse decode, the full dossier lifecycle (toggle, auto-fold cancellation, mid-animation guard), tether HUD layout, and SFX wiring
2026-09-04 10:25:37 -06:00
Brian Fertig fbd0e56f1f Extract shared decode scramble and apply it to the system dossier HUD
- New `js/utils/Decode.js` with a pure `ScrambleDecode` class plus
  `DECODE_CHARS`, `DECODE_DURATION`, and a per-line `decodeDur()` helper,
  so one effect serves both scenes.
- MenuScene now delegates its seed scramble to the shared utility instead
  of inlining the reveal math and alphabet.
- GameScene's system dossier types itself in on arrival: each line starts
  empty and decodes left-to-right, staggered top-to-bottom, with the
  timeline anchored on the first update frame; state self-clears once all
  lines settle so `update()` pays nothing afterward.
- Add Node dev tests for the shared effect contract (`dev/decode.test.mjs`)
  and for the real GameScene dossier decode against actual galaxy/report
  data with a stubbed scene (`dev/system-hud.test.mjs`).
- Document both new test commands in the README and update the planets
  PSD asset.
2026-09-04 09:52:05 -06:00