# Tower Defence Waves, placement, currency UI, navigation curves. ```{raw} html ▶ Run in browser

Upstream: https://github.com/russs123/tower_defence_tut

``` **Tags:** `port` `tier-1` # Tower Defence (SimVX port) SimVX port of [russs123/tower_defence_tut](https://github.com/russs123/tower_defence_tut) (YouTube tutorial source, MIT-style permissive). Wave-based tower defence on a fixed map with a hand-authored enemy path; ports the upstream's animated basic turret + four upgrade tiers and adds **slow** and **sniper** turret variants for the Tier-1 multi-tower-type acceptance bar. ## Run All commands from the SimVX repo root (`uv` workspace requirement): ```bash # Interactive uv run python ported_games/tower_defence_tut/simvx_port/main.py # Headless smoke test (frame_30/60/120 captures) uv run python ported_games/tower_defence_tut/simvx_port/main.py --test # Scripted harness (10 stage screenshots covering 3+ waves) uv run python ported_games/tower_defence_tut/simvx_port/harness.py # Web export uv run simvx export web ported_games/tower_defence_tut/simvx_port/main.py \ -o ported_games/tower_defence_tut/simvx_port/web/index.html ``` ## Controls | Action | Keyboard | Mouse | |---|---|---| | Start (menu) | `Enter` / `Space` | Click anywhere | | Place BASIC turret | `1` / `B` | "BUY BASIC" panel button | | Place SLOW turret | `2` | Cycle TYPE then "BUY" | | Place SNIPER turret | `3` | Cycle TYPE then "BUY" | | Cancel placement | `Esc` | "CANCEL" panel button | | Begin wave | `Enter` / `Space` | "BEGIN WAVE" panel button | | Fast-forward x2 | `F` | "FAST x2" panel button | | Upgrade selected turret | `U` | "UPGRADE -> Lx (100c)" panel button | | Restart | `R` | "RESTART" panel button | | Quit | `Q` / `Esc` (menu) | - | ## Touch / mobile Tower placement is a single tap on a grass tile -- the SimVX web runtime surfaces touchstart/end as `MouseButton.LEFT`, so the browser export is playable on mobile without code changes. ## Tower types | Type | Cost | Range (L1) | DPS (L1) | Notes | |---|---|---|---|---| | Basic | 200 | 120 | ~5.5 | Animated turret from upstream tutorial | | Slow | 250 | 70 | ~2.5 | Applies a 0.5x slow debuff for 1 s on hit | | Sniper | 350 | 200 | ~5.8 | Long range, slow rate, big single-shot damage | All three types support 4-tier upgrades. ## Source ```{literalinclude} ../../examples/ports/tower_defence_tut/main.py :language: python :linenos: ```