# 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.*