# STELLAR DRIFT

A No-Man's-Sky-style exploration slice in Three.js. Fly from orbit down to a
procedurally-generated alien world, land, survey alien flora, mine crystallite,
repair your pulse drive, then chart a second, visually-distinct planet.

**Everything is procedural** — seed-driven noise terrain, canvas-generated planet/cloud/
nebula maps, kit-bashed flora from primitives, shader atmospheres, procedural Web Audio
SFX. No downloaded models, textures, or audio.

## Run
```bash
npm install
npm run dev        # play at the printed localhost URL
npm run build      # production build (base:'./', deploys under any subpath)
npm run preview    # serve the build on :4173
```

## Controls
- **Space flight:** mouse steers (pitch/yaw) · `W` thrust · `Shift` boost (speed-lines) · `E` to land when in range
- **Surface (on foot):** `WASD` move · mouse look · `Space` low-gravity jump · `C` scan · hold `LMB` mine · `E` at your ship to launch
- **Mobile:** on-screen joystick + SCAN / MINE / ENTER-EXIT buttons

## Goal
Scan 5 species + mine 40 crystallite → pulse drive repaired → launch → land the second
world → **SYSTEM CHARTED**.

## Debug hook
`window.__game` is kept live: `{ phase, mode, planet, units, scans, resources,
land(), takeoff(), teleportPlanet(i), start() }` plus screenshot helpers
(`_spaceShot`, `_entry`, `_faceShip`, `_scanShot`, `_grantGoal`). Append `?seed=N` for a
fixed system, `?debug` for the FPS readout, `?auto` to auto-start.

## Self-eval
`node shots.mjs` boots a preview server and captures the five rubric vantages (+ win,
mobile) via Playwright into `shots/`. See `PROGRESS.md` for the scoring log.

## Modules
`main.js` (orchestration/modes/input) · `space.js` (system/starfield/sun) ·
`planet.js` (seed→palette/terrain + orbit spheres) · `surface.js` (heightfield/sky/FP
controller) · `flora.js` (instanced alien plants + minerals) · `scanner.js` (scan pulse +
mining) · `ship.js` (ship + flight) · `post.js` (ACES/bloom/grade) · plus
`noise.js`, `names.js`, `hud.js`, `audio.js`.
