tower-defense
What it does
This skill guides building tower defense games where enemies follow a path and the player places towers to stop them. It is for developers making wave defense games and balancing their waves and economy.
When to use it
- βWhen you are building a tower defense game where towers attack enemies that follow a path.
- βWhen you need to design wave composition and pacing.
- βWhen you want the gold economy and tower upgrades to feel balanced.
Skill link
https://github.com/gamedev-skills/awesome-gamedev-agent-skills/blob/main/skills/genres/tower-defense/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agentβs skills folder.
Example of what to ask your AI
βI am making a tower defense game. Can you set up enemies walking a path, towers that shoot automatically, and a wave spawner?β
5 new skills a week. 1 minute to read.
How it works
The agent makes the enemies follow a lane or a maze path, sets up timed waves with scaling enemy types, and has towers auto-target and fire. Kills earn gold, which pays for placing and upgrading towers.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
Tower Defense
A playbook for tower defense β enemy pathing, wave spawning, tower targeting, and the economy that ties them together. This is a compositional skill: it orchestrates pathing, AI, and UI into a TD loop. It does not re-teach pathfinding; it defines the systems and the balance levers (DPS vs. HP vs. income) that decide whether a TD is tense or trivial.
When to use
- Use when building a game where the player places towers that automatically attack waves of enemies following a path, spends earned currency to expand/upgrade, and loses if too many enemies leak through.
- Use when designing wave composition/pacing, tower targeting priorities, or the gold economy.
When not to use: the player directly controls a shooter β fps-shooter. Free-form base
building with needs β survival-crafting. For the pathfinding algorithm itself, use game-ai.
Core loop
Prepare (place/upgrade towers with current gold) β start the wave β enemies path toward the goal while towers auto-fire β earn gold from kills β survive the wave β repeat against a harder one. The tension is a planning puzzle: is my current DPS enough for what's coming, and can I afford the answer?
Must-have systems
- Enemy path β waypoint lanes, or grid + pathfinding for maze TD (refs).
- Wave spawner β timed, scripted sequences of enemy types with per-wave scaling.
- Towers β range, fire rate, damage, projectile/hitscan, splash; placement validity.
- Targeting β per-tower priority (first/last/closest/strongest/weakest) (refs).
- Economy β gold from kills + wave bonuses; tower/upgrade costs; sell refund.
- Lives / leak β enemies reaching the goal cost lives; 0 = game over.
- Wave/prep UI β lives, gold, next-wave preview, start-next-wave control.
Design knobs
| Knob | Effect | Notes |
|---|---|---|
| Enemy HP growth/wave | upgrade pressure | Geometric ~1.1β1.2Γ (refs). |
| Income vs. HP curves | difficulty | Player should almost afford each wave. |
| Tower DPS / range / cost | tower identity | Cheap+wide vs. expensive+tall. |
| Targeting priority | optimal placement | Changes play more than raw stats. |
| Enemy variety | counters one-build wins | Fast / armored / flying / swarm / boss. |
| Leak penalty | stakes | Cost lives and lost bounty. |
| Upgrade vs. build economy | strategy depth | Diminishing upgrade returns. |
| Wave pacing | tension curve | Spike β breather β spike, not monotonic. |
Patterns
1. Wave spawner (timed, data-driven)
# Pseudocode. A wave is data: a list of (enemy_type, count, spacing). Spawn over time.
wave = [ ("grunt", 10, 0.5), ("runner", 5, 0.3), ("tank", 2, 1.0) ]
def run_wave(wave):
for enemy_type, count, spacing in wave:
for _ in range(count):
spawn_enemy(enemy_type, at=path[0]) # enter at the path start
wait(spacing) # seconds between spawns (use a timer/coroutine)
# wave clears when all spawned enemies are dead or have leaked
2. Tower targeting (filter to range, then pick by priority)
# Pseudocode. "First" (furthest along path) is the standard default for stopping leaks.
def acquire_target(tower, enemies, mode="first"):
in_range = [e for e in enemies if distance(tower.pos, e.pos) <= tower.range]
if not in_range: return None
if mode == "first": return max(in_range, key=lambda e: e.progress) # furthest along path (stop leaks)
if mode == "last": return min(in_range, key=lambda e: e.progress) # least progress (guard the entrance)
if mode == "closest": return min(in_range, key=lambda e: distance(tower.pos, e.pos))
if mode == "strongest":return max(in_range, key=lambda e: e.hp) # burn down tanks first
if mode == "weakest": return min(in_range, key=lambda e: e.hp) # secure kills / last-hit bounty
return in_range[0]
3. "Can this lane hold?" sanity check (DPS vs. HP)
# Pseudocode. One tower's damage to one enemy crossing its range.
tower_dps = tower.damage * tower.fire_rate
time_in_range = tower.range_coverage_length / enemy.speed
FAQ
How does the path work?
The skill covers waypoint lanes or a grid with pathfinding for maze style games.
What makes a tower defense game tense?
The skill says the tension comes from planning whether current damage is enough for the next wave, and whether you can afford the answer.
Does it cover the pathfinding algorithm itself?
No. The game AI skill covers the pathfinding algorithm, which this skill uses.
Details
Original description by the author
Build a tower defense: enemies pathing along lanes, wave spawning, towers that auto-target and fire, an economy, and lives. Use for a tower-defense/wave-defense game, or balancing waves and economy.
Popularity
- GitHub stars
- 6.6k
- Ranking position
- #13814
- License
- Apache-2.0
- Updated
- 10/28/2026
Comments
- β¦
More skills from this repository
router
6.6kHelps your agent pick the right game development skill for a request by detecting your engine and the kind of task you need.
ai-behavior-trees-utility-ai
6.6kHelps your agent build a behavior tree and utility AI system for game enemies and characters that choose actions by priority and score.
audio-design
6.6kTeaches your agent game audio mixing: buses, decibel volume, ducking under dialogue, adaptive music and sound effect variation.
camera-systems
6.6kHelps your agent build game cameras that follow smoothly, stay inside the level, and orbit or look around in 3D.
Similar skills
diffs
394kLets your agent produce a real, shareable diff of edits as a viewer link or image file, instead of a hand-written summary.
coding-agent
394kHelps your agent hand a larger coding job to Codex, Claude Code, or OpenCode as a background worker, then check on its progress.
gh-issues
394kHelps your agent find GitHub issues, pick the ones to work on, and open pull requests with fixes, including follow-up on review comments.