Commit Graph

3 Commits

Author SHA1 Message Date
Brian Fertig 407f6d6175 Add Continue button to main menu for resuming newest save
- SaveManager.latest() picks the filled slot with the newest savedAt
  (unparseable timestamps count as oldest; ties break to the higher slot)
- MenuScene wires a Continue button above New Game, grayed out while the
  bank is empty, that stages the restore via prepareLoad and cuts into
  GameScene without a confirmation beat
- Shift menu layout down to make room and park the Reroll button fully
  outside the seed field so its edge no longer bites the field
- Cover latest() behavior in dev/saves.test.mjs and update README and
  PROJECT_NOTES to reflect the finished save/load feature
2026-09-05 12:30:16 -06:00
Brian Fertig 520cba85f6 Add mining economy: rock shrink, split/shatter, and mineral hold
- Extract minerals from the latched asteroid at ratePerSec × miningSpeed; each mineral shrinks the rock by 1 px so the beam stays latched to its rim.
- Break rocks that lose ~1/3 of their original size: large ones halve in place (beam keeps mining one half), small ones shatter into pieces that fly home and load the hold.
- Add ship.minerals hold with addMinerals/setMinerals capped at stats.mineralStorage; a full hold ends the run instead of grinding the rock away.
- Persist the hold in save/restore (captureState writes ship.minerals, applyRestore restores it) and keep legacy saves working when the field is absent.
- Play new mining_split sfx on each break and surface split/absorbed/storageFull events as console toasts.
- Expose AsteroidCluster rock surgery (setSize/addRock/removeMember) for runtime splits, and add headless Phaser stub + loader plus a mining test suite covering extraction, halving, shattering, full-hold stop, and the hold API.
2026-09-05 11:18:35 -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