Canonical benchmark brief

14. Low-Poly Tower Defense

Back to all prompts
# 14. Low-Poly Tower Defense

Build a low-poly 3D tower defense game on a floating diorama island. Enemies follow a winding path from a portal to the island's heart; the player spends gold on towers to stop them. Survive all 10 waves without losing 20 lives to win. A defeat screen at 0 lives, a victory screen after wave 10 — not an endless mode.

The point is a legible economy of decisions: kills earn gold, gold buys and upgrades towers, and every wave the player re-reads the battlefield and adapts. A first-time player should grasp the whole game from one look at the HUD: gold, lives, wave 3/10.

The first screen must state the goal in one line ("Stop 10 waves. Don't lose 20 lives.") with the controls below it. One click starts the run. No other menus.

## Core Loop

- Enemies spawn at the portal and walk the fixed path to the heart. Reaching the heart costs lives (1 per enemy, 3 per elite).
- The player places towers on valid build tiles beside the path using gold. Towers attack automatically in range.
- Kills award gold instantly. Between waves the player builds, upgrades, or sells; a Start Wave button (or Space) launches the next wave.
- Waves escalate in count, HP, and enemy mix. Wave 10 is a boss wave with a single large enemy.
- All 10 waves cleared with lives remaining → victory screen. Lives at 0 → defeat screen. Both show stats (gold earned, kills, towers built) and a Restart that works without reloading the page.

## Economy and Towers

- Starting gold must afford exactly 2 basic towers with a little left over. Gold, kill bounties, tower costs, and sell refunds (75%) must all be visible and consistent.
- Exactly 3 tower types, each with a clear role:
  - **Arrow tower** — cheap, fast, low damage; the breadline.
  - **Cannon tower** — slow, splash damage around the impact; the answer to packs.
  - **Frost tower** — no damage or token damage; slows enemies in range; the force multiplier.
- Each tower has 2 upgrade tiers above base. Upgrades cost more than the previous tier and visibly change the tower (size, color accents, projectile) and its stats (damage, range, rate, slow strength).
- Towers can be sold for a 75% refund of total gold spent on them.

## Waves and Enemies

- 10 hand-tuned waves, previewable: before starting a wave, the HUD shows its composition (counts and types).
- At least 4 enemy types, distinct in silhouette and color:
  - **Runner** — fast, low HP.
  - **Soldier** — balanced.
  - **Brute** — slow, high HP.
  - **Boss** — wave 10 only; huge HP bar, slow walk, worth 10 lives if it leaks.
- Flying or path-ignoring enemies are out of scope.

## The Island

- A single floating low-poly diorama: cliff sides, water or clouds below, trees/rocks as decoration, a readable path from portal to heart.
- Flat-shaded geometry, soft daylight, gentle shadows. The aesthetic should match a premium low-poly illustration, not grey boxes.
- Build tiles are visibly marked (flat pads or plots). Invalid placement (path, water, occupied) must be rejected with clear feedback.
- Towers and enemies read clearly at the default zoom: color-coded, with HP bars on damaged enemies.

## HUD and Screens

- Always visible: gold, lives, wave counter ("Wave 3 / 10"), and the Start Wave control.
- Selecting a tile or tower shows a small radial or panel: build options with costs, or upgrade/sell with costs and stat deltas.
- Speed control: 1× and 2×. Pause at any time.
- Victory and defeat screens: run stats and a Restart button.

## Controls

- Mouse: hover to inspect, click tile to build, click tower for upgrade/sell, drag to pan slightly or orbit a few degrees.
- **1 / 2 / 3**: select tower type — **Space**: start wave — **F**: toggle speed — **Esc / P**: pause — **Enter**: confirm.
- Keyboard-only play must be possible: Tab cycles build tiles and buttons; Enter activates.

## Visual Rules

- Full-screen 3D rendered into a `<canvas>` via Three.js (or comparable WebGL via CDN, listed in `manifest.json.externalAssets`).
- No external models, textures, or audio fetched at runtime; all geometry procedural or code-built.
- Combat feedback: projectiles visible in flight, muzzle flash or glow, splash radius flash, frost tint on slowed enemies, gold bounty popups on kills.
- Honor `prefers-reduced-motion`: reduce particle bursts and idle bobbing; gameplay unchanged.
- 30+ fps at 1280×800 with the final wave on screen.

## Hard Requirements

- Single `index.html`, no build step; opens over `file://`.
- Keyboard accessible; `lang="en"` on `<html>`.
- Persist best wave reached in `localStorage` and show it on the first screen.
- No login, no analytics, no network requests for runtime art, models, audio, or data.

Expose a small automated verification hook:

```js
window.__defense = {
  ready: true,
  getState(),        // phase (start/build/wave/victory/defeat), gold, lives, wave, speed
  startGame(),
  startWave(),
  setSpeed(n),       // 1 or 2
  getTiles(),        // build tiles with occupancy
  placeTower(type, tileId),
  upgradeTower(towerId),
  sellTower(towerId),
  getTowers(),       // type, tier, damage, range, spent gold
  getEnemies(),      // type, hp, path progress, slowed state
  getWavePreview(n)  // composition of wave n
};
```

The hook must call the same game functions the UI uses, not a parallel simulation.

## Loop / Validation Rule

Do not stop until you have personally verified all of the following in a browser:

1. The first screen states the goal and shows best wave from `localStorage`; starting a run has no console errors.
2. The island, path, portal, and heart are immediately readable; build tiles are visibly marked.
3. Placing an arrow tower on a valid tile deducts the correct gold; invalid tiles are rejected with feedback.
4. Starting a wave spawns its previewed composition; enemies follow the path and towers fire automatically in range.
5. Kills award the correct bounty instantly; leaks reduce lives by the correct amount (1 normal, 3 elite-type, 10 boss).
6. Cannon splash damages multiple enemies; frost visibly slows enemies (tint + speed) without killing them.
7. Both upgrade tiers change tower stats and appearance; selling refunds 75% of total spent.
8. Speed toggle runs the wave at 2×; pause halts everything; keyboard-only play (Tab/Enter/1-2-3/Space) completes a full wave.
9. Lives reaching 0 shows the defeat screen; clearing wave 10 (boss included) shows the victory screen; Restart resets cleanly without reload.
10. The wave counter, gold, and lives are always correct and readable at 1280×800.
11. Reduced-motion mode keeps the game fully playable.
12. The game holds 30+ fps during wave 10 at 1280×800.

If any check fails, fix the specific mechanism and run all twelve checks again.