Repterra Web — full game: base building, power grid, taming & breeding, aquatic raiders, day/night, save/load

- Isometric canvas RTS vs dinosaur waves (fan demake of Repterra)
- Economy: houses/taxes, farms, foresters, quarries; colonist staffing
- Power grid: generators extend build range; brownout + recovery
- Defense: walls/gates, watchtowers (AA), cannon towers (ground-only)
- Taming: Primal Pen + Tamers collar weakened dinos; pets obey commands
- Breeding: tamed pairs incubate eggs at the pen; hatchlings grow up
- 7 dino species incl. flying Pteranodons and lake-raiding Suchomimus
- Telegraphed waves with direction arrows; day-15 final horde; 3 difficulties
- Day/night cycle, fog of war, minimap, synth audio, 1x-3x speeds
- Save/Load/Continue + dawn autosave (full JSON state snapshots)
- Tests: 80-assertion headless suite, browser boot + E2E, balance harness
This commit is contained in:
2026-08-23 07:00:23 +00:00
commit 8fbe70d0b0
21 changed files with 6583 additions and 0 deletions
+103
View File
@@ -0,0 +1,103 @@
# REPRTERRA WEB 🦖
A **fan-made browser demake** of [Repterra](https://store.steampowered.com/app/2768380/Repterra/)
(Chute Apps / MicroProse) — the base-building survival RTS best described as
*"They Are Billions, but the horde can fly."*
Everything is hand-drawn on canvas at runtime — no image assets, no build step,
no dependencies. Plain JS + HTML + CSS.
## Play
```bash
npm start # serves http://127.0.0.1:8933
```
…or just open `index.html` directly in a browser (works from `file://` too).
## The loop
1. **Grow** — Houses raise population cap and pay taxes; colonists arrive at your
Command Center and staff Farms, Forester Huts and Quarries.
2. **Expand** — Generators produce energy *and* extend your power grid; you can
only build touching your grid. Overload it and newest buildings go dark.
3. **Fortify** — Walls and Gates block ground dinos. Towers shred them.
4. **Survive** — telegraphed waves attack every couple of days
(a warning arrow shows *where* they'll hit). Roaming packs prowl the map —
kill them before day 15, because…
5. **☠ THE FINAL WAVE** — every surviving dino on the map charges your Command
Center. Lose the HQ and the colony falls.
### ⚠ The sky is NOT safe
Pteranodons **fly over walls**, straight for your soft economy buildings.
Cannon towers can't shoot up — keep Watchtowers and Rangers covering the air.
### ⚠ Neither is the water
From day 8 (normal), **Suchomimus raids emerge from the lakes** — a fully
walled base with no waterfront watch is still on the menu.
### 🦴 Turn the horde into your army
Build a **Primal Pen**, train a **Tamer**, weaken any dino below 32% HP and the
Tamer slips a capture collar on it. Tamed dinos fight for the colony —
right-click to give them a new guard post or order an attack. The Pen heals
your pets and each Pen adds +2 tame slots. (A T-Rex is too powerful to tame.)
### 🥚 Breed them
Park **2+ tamed dinos** beside a powered Pen and they'll incubate eggs (60 food
each, max 2 per Pen). Hatchlings start small and grow into full-size fighting
adults — a self-sufficient dino economy.
### 💾 Your colony persists
Save from the pause menu, autosave at every dawn, and hit
**▶ Continue saved colony** on the main menu. Saves are plain JSON snapshots of
the whole simulation — world depletion included.
## Dinosaur roster
| Dino | Threat |
|---|---|
| Compsognathus | fast swarm fodder |
| Velociraptor | quick flanker |
| Dilophosaurus | ranged spitter |
| Triceratops | wall-crusher (×2.5 building dmg) |
| Pteranodon | ☠ flying, ignores walls |
| Suchomimus | 🌊 amphibious — raids from lakes |
| Tyrannosaurus Rex | boss, smashes anything, untameable |
Plus roaming packs of all of the above from minute one. Day turns to night
over the colony (powered buildings glow warm after dark).
## Controls
| Input | Action |
|---|---|
| WASD / arrows / screen edge | pan camera |
| Mouse wheel | zoom to cursor |
| Middle-drag | grab-and-drag pan |
| Left click | select / place |
| Left drag | box-select Rangers |
| Right click | move order · focus-fire a dino · rally point (barracks/pen selected) · pet move/attack (tamed dino selected) · capture priority (tamer selected) |
| `1``9` | build hotkeys |
| Shift-click | multi-build · hold to keep placing walls |
| `Space` / `P` | pause |
| `F` | jump to HQ |
| `Del` | demolish selected building (+50% refund) |
| `M` | mute |
| `+` / `-` / `0` | game speed 1×/2×/3× |
## Tech notes
* ~5k lines of dependency-free vanilla JS (`js/*.js`, plain script tags).
* Isometric canvas renderer with depth sorting, fog of war, particles,
animated procedural sprites (every dino/building drawn in code).
* Sim core is DOM-free → fully headless-testable:
* `npm test` — smoke suite (~70 assertions: placement rules, economy,
pathfinding, waves, power-grid chains, taming & pet combat, breeding,
save/load fidelity, victory & defeat paths).
* `npm run balance` — scripted auto-player runs full games at every
difficulty and reports survival curves (relative difficulty signal).
* `node test/browser.js` / `test/e2e.js` — real-Chromium boot + interaction
tests, including a save → reload → continue lifecycle
(needs `npx playwright-core install chromium-headless-shell`).
*Fan project for personal enjoyment; not affiliated with Chute Apps or MicroProse.*