# Last Light

**Last Light** is a compact top-down extraction shooter built for the browser. The district is sealed, the grid is failing, and the player has five waves to collect field cash, tune a loadout, and defeat the Lockdown Juggernaut.

One run is designed to deliver a complete arc in roughly three minutes: immediate combat, upgrade decisions after waves two and four, a boss finale, and a scored win/fail result that can be copied and shared.

## Play

No account, install, backend, API key, or paid service is required. Open `index.html` directly in a modern desktop browser, or serve the folder locally:

```bash
node server.js
```

Then open <http://127.0.0.1:5173>.

The deployable build is fully static. A host only needs these files:

- `index.html`
- `styles.css`
- `game.js`

`server.js` is a dependency-free convenience server for local review; it is not required in production.

## Controls

| Input | Action |
| --- | --- |
| `W` `A` `S` `D` | Move |
| Mouse | Aim |
| Left click or `Space` | Fire |
| `Shift` | Dash with brief damage immunity |
| `R` | Reload |
| `Q` | Deploy a hardlight wall, after buying the upgrade |
| `E` | Deploy a sentry, after buying the upgrade |
| `P` or `Esc` | Pause / resume |

## Game loop

1. Survive five escalating waves in a dark industrial district.
2. Earn field cash and score from kills and wave clears.
3. Visit the Blackout Market after waves two and four. Each offer can be installed once per market, so buying an upgrade never rerolls the choices.
4. Defeat the Lockdown Juggernaut on wave five and extract.
5. Chase a faster clear and higher score. Best score persists locally when browser storage is available.

Armor, ammunition, pickups, destructible deployed cover, sentries, critical hits, piercing rounds, explosive rounds, health regeneration, a combat drone, and a shock dash create distinct builds across short runs.

## Design notes

- **Fast first minute:** the first click goes directly into combat; controls and the objective are visible before play.
- **Complete short arc:** a five-wave structure gives the run a readable opening, two decision points, a climax, and a clear result in one sitting.
- **Readable under pressure:** silhouettes, tracers, health bars, damage numbers, hit particles, screen shake, and the light cone communicate state without external art assets.
- **Meaningful decisions:** upgrade offers remain fixed during each market visit, preventing accidental rerolls and making spending a deliberate tradeoff.
- **Original identity:** the blackout-extraction premise, field-market cadence, deployable gear, and light-constrained arena are an original combination rather than a straight clone of a known game.
- **Shareability:** the result screen records score, time, kills, and local best, then produces a one-click copyable challenge line.
- **Portable by design:** all visuals are drawn with Canvas 2D and CSS. There are no frameworks, packages, remote fonts, analytics, cookies, network calls, or hidden services.

## Technical overview

- Vanilla HTML, CSS, and JavaScript
- Canvas 2D renderer with a fixed world and eased camera
- Delta-time update loop capped against large frame spikes
- Circle/rectangle collision handling for actors, arena cover, and deployed barriers
- Local-only best-score persistence with a storage-disabled fallback
- Responsive overlay layout and reduced-motion support
- Keyboard pause and automatic pause when the page is hidden

## Browser support

Designed for current desktop releases of Chrome, Safari, and Firefox. The game uses standard Canvas 2D, DOM, and Web Storage APIs and has no browser-specific dependencies. Keyboard and mouse are required for the intended desktop-first experience.

## Project structure

```text
.
├── index.html               # UI and game canvas
├── styles.css               # HUD, menus, market, and result presentation
├── game.js                  # Simulation, combat, rendering, scoring, and input
├── server.js                # Optional zero-dependency local static server
├── README.md                # Controls, run instructions, and design notes
└── SUBMISSION_CHECKLIST.md  # Final publishing and entry checklist
```

## Privacy and data

Last Light makes no network requests. It stores only one optional number—the best score—in the browser's local storage. If storage is unavailable, the full game still works and simply treats each run independently.

