Commit Graph

8 Commits

Author SHA1 Message Date
Brian Fertig 146dc207df Add compact far-display mode to the discovery compass
- Targets beyond `farDistance` from the ship fold to a small text-less chip with a shrunken arrow, reducing visual clutter for distant objects
- Hovering a far chip expands it to the full readout after an intent delay; hovering off folds it back only after a grace period, so quick flicks don't pop or yank it
- Assign per-type compass accent colors: green for planets (data/planets.json), red for stations (data/stations.json), gray for asteroid clusters (already present)
- Export `isFarTarget` and `syncEntryMode` as pure helpers for Node testing; add far-display coverage to dev/discovery.test.mjs
- Add a headless integration driver (dev/compass-far.html + .mjs) that boots GameScene, parks the ship between near and far targets, and exercises the hover-intent lifecycle end-to-end
- Pass the ship position into `compass.refresh()` from GameScene so the compass can compute per-target far/near state each frame
2026-09-07 11:07:20 -06:00
Brian Fertig 75c9f99ecb Add Shift+click throttle lock for committed-heading flight
- Ship gains a `thrust` state and `thrustToward()` that commits to the heading toward the click point and holds full throttle past it, until a plain click or stop steers out.
- GameScene pointer handler branches on `pointer.event.shiftKey`: Shift+click locks the heading (raw aim), plain click still flies to the clamped stop point.
- Mining teardown no longer stomps the ship state when the player has already moved it into `thrust`/`normal`.
- Update hint text and add unit tests (tests 7–10) plus a live-scene smoke harness (`?thrusttest=1`) verifying past-click flight, steer-back arrival, stop braking, and mining-exit signaling.
2026-09-07 00:06:57 -06:00
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 30af365c68 Add the tether: the player's range, a level-1 zone (5120 px) with a glitchy barrier rim
The player starts with a level-1 tether anchored on the home world:
a circular zone 5120 px from the planet's center. The ship may fly
anywhere in the UNION of its tethers' zones — where zones overlap there
is no line and no wall — and the union's boundary is a hard barrier,
rendered as a thick cyberpunk glitch dotted line (marching dashes,
additive glow + RGB fringe, ambient glitch bursts with dash flicker,
radial displacement and data drops, contact shudder + camera kick +
throttled console toast where the ship bumps it).

- data/tether.json: level radii (5120 x 1.25^lv), the starting tether,
  barrier line/look, glitch and contact tuning (manifest-registered)
- js/tether/Tether.js: pure range math (union membership, clamp to the
  nearest union boundary point + normal, visibleArcs = each tether's
  share of the union boundary) — Node-tested
- js/tether/TetherField.js: scene-facing field — add/remove/setLevel
  seam for future builds/upgrades, per-frame ship constraint, and the
  barrier renderer (on-screen dot culling only)
- js/scenes/GameScene.js: home tether at the system origin, HUD
  readout (level / range / anchor per tether), click-to-fly and
  autopilot targets clamped to the union boundary, contact feedback,
  destruction on shutdown
- dev/tether.test.mjs: 29 checks incl. the two-direction boundary
  property (no line in overlaps, no gaps in the line) and a numeric
  nearest-boundary cross-check (worst 0.79 px)
- dev/smoke-game.mjs: ?tethers / ?homeLevel / ?report dev hooks for
  manual and headless verification
- README + PROJECT_NOTES: the system, its rules and its layering

Verified in headless Chromium: clean boot (menu + game), barrier
rendering (calm and glitch-burst frames), union boundary with two
tethers (arcs meet at the rim crossings, lens is line-free), ship
clamped exactly onto the rim from outside, contact toast fired.
2026-09-03 22:03:29 -06:00
Brian Fertig 8c52105412 Add discovery system with off-screen compass and in-world planet layout
- Discovery rule: ship within `discovery.distance` (540 px) of a world's edge discovers it once per system; state is pure, save-ready (`Discovery.toJSON/fromJSON`)
- Off-screen compass (`DiscoveryCompass`): themed screen-edge arrows with type/name chips point back at discovered worlds; geometry helpers (`edgeAnchor`, `circleInView`, `lerpAngle`) exported for Node tests
- Solar-system layout: `layoutSystemPlanets` places generated worlds in a deterministic annular band around the home world, enforcing edge-to-edge separation and per-class scale/tint from `data/planets.json`
- All system planets are solid to the ship (collision + click-clamp), not just home
- Rim ping + HUD toast on discovery (`celebrateDiscovery`)
- New planet class pools (rocky/gas/ice/lava) with frames, `classScale`, `classTint`, and `typeLabels`
- Smoke-game dev hooks: `?ship=x,y` and `?near=px` for screenshotting discovery/compass states
- Node test suite (`dev/discovery.test.mjs`) covering rule boundaries, per-system state, JSON round-trip, layout bounds/determinism, compass geometry, and class pools
2026-09-03 19:45:21 -06:00
Brian Fertig eafc3c4314 Add v0.2: seedable galaxy, system archetypes, and two-level procedural generation
- Main menu Galaxy Seed panel: displayed, editable, rerollable; the menu
  previews what the seed builds (galaxy name, scale, archetypes) before
  committing. Same seed always generates the same galaxy.
- js/galaxy/Galaxy.js: seeded roster of 40k systems (disk + core + spiral
  arms, type weights, radial bands) with spatial hash for neighbor queries;
  contents generated lazily on arrival — identical to eager generateAll()
  because each system draws from Rng.derive(seed, 'system', id).
- js/galaxy/SystemGenerator.js + data/systems.json: six themed archetypes
  whose attributes (star classes, planet count spread, class weights,
  moons, belts, habitability, hazard) steer content generation.
- data/galaxy.json layout/distribution knobs, incl. distribution.rules[]
  hook for future proximity/clustering rules; data/naming.json name pools.
- GameScene: current system name/identity HUD (lazy content generation
  on arrival); dev boot without a menu falls back to a dev galaxy.
- dev/galaxy.test.mjs: determinism, distribution, bands, lazy==eager,
  neighbor brute-force checks (40k roster in ~70ms).
- Docs: world model, determinism rules, roadmap update.
2026-09-03 10:49:22 -06:00
Brian Fertig 7cf96bb237 Ship Travel and Orientation Updates 2026-09-03 10:25:54 -06:00
Brian Fertig eddbedbf1c Add v0.1 foundation: menu, click-to-fly ship, and JSON config system
- Boot the game from a static server with no build step (Phaser 4 vendored in lib/)
- Main menu (New Game button) and GameScene where clicking makes the ship fly there
- All tunables live in data/*.json (game/menu/ship), loaded via manifest + Config singleton
- Ship behavior driven by arcade physics (thrust, drag, maxSpeed, arrival) with a Node test harness (dev/ship-behavior.test.mjs) and a dev smoke page that boots straight into GameScene
- Project conventions documented in docs/PROJECT_NOTES.md; README rewritten to describe layout, run instructions, and dev tools
2026-09-02 22:31:34 -06:00