Skip to content
AI-powered appsNewChat, vision, voice, generationBookings & schedulingAppointments that book themselvesShops & sellingA storefront in every pocketClient & businessRun the operation from one placeCommunities & clubsA home that is not a group chat
Health & wellnessHabits, tracking and calmGames2D, 3D and multiplayerPersonal & toolsThe tool you wish existedInternal toolsThe tool ops never had time for
See all use cases
ArcadeNewPricingSecurity
EngineThe game engine and World EditorHow it worksFrom one sentence to a live productDocsGuides for building and publishingBlogStories, guides and newsChangelogWhat shipped latelyStatusUptime of every serviceSupportGet help from the team
AI-powered appsBookings & schedulingShops & sellingClient & businessCommunities & clubsHealth & wellnessGamesPersonal & toolsInternal tools
See all use cases
ArcadeNewPricingSecurity
EngineHow it worksDocsBlogChangelogStatusSupport
Language
Blog
GamesNovember 22, 20266 min read

How to Make a Tower Defense Game

Tower defense is a spreadsheet you can play. Here is how to set up the path, the waves, the towers and the money so the spreadsheet is fun.

Startbase Team
Editorial ink illustration of a wooden turret beside a winding path of marching beetles, the turret's cannonball in ember orange

Key takeaways

  • Write the waves as a table (enemy, count, spacing, health, bounty) before you build. The table is the game.
  • Give every tower a role that answers a specific enemy, so no single tower wins every wave.
  • Balance with one number: damage per second per coin spent. If one tower is far ahead, players will build only that tower.

To make a tower defense game you need four pieces: a path enemies walk along, a wave table that says what comes when, a handful of towers with distinct roles, and an economy where kills pay for more towers. Most of the design work is in the wave table and the tower roles, not the code. An AI builder can produce the code from a good description; this guide is about writing that description well and balancing what comes back.

Fixed path or open field

Decide early which of the two classic layouts you are making, because it changes everything downstream.

  • Fixed path (Kingdom Rush, Bloons): enemies follow a road you drew, towers go on build spots or open ground beside it. Easier to balance, easier to read on a phone, and the path itself becomes a level design tool.
  • Mazing (the old Warcraft III custom maps, Desktop Tower Defense): enemies walk from entrance to exit across an open grid and your towers form the walls. Deeper, but you need pathfinding that recomputes as towers are placed and a rule that forbids fully blocking the exit.

For a first game, use a fixed path. The path’s length is your main difficulty lever per map: a long winding road gives towers more time to shoot, so the same wave is easier. Loops that pass the same spot twice create hot spots where a well-placed splash tower hits enemies twice, which players love discovering. Store the path as a list of waypoints and move enemies along it by distance traveled, which also makes the “first” targeting mode trivial: the enemy with the greatest distance is first. For how enemies move and react beyond following the path, see enemy AI behaviors.

Write the wave table

The wave table is where tower defense is designed. Each row is a group of enemies; a wave can have several groups. Here is the start of a table for a 20-wave map:

  • Wave 1: 8 Scuttlers (fast, 20 HP, 3 gold), one every 1.0 s.
  • Wave 2: 12 Scuttlers, one every 0.8 s.
  • Wave 3: 6 Shellbacks (slow, armored, 80 HP, 8 gold), one every 1.5 s. First armor check.
  • Wave 4: 10 Scuttlers, then 4 Shellbacks.
  • Wave 5: a swarm of 30 Mites (8 HP, 1 gold) at 0.25 s spacing. First splash check.
  • Wave 6: 3 Gliders (flying, ignore ground-only towers, 40 HP). First air check.
  • Wave 10: mini-boss, one Brood Mother (800 HP) that splits into 6 Mites on death.

Notice the pattern: each new enemy type arrives alone first so the player learns what it is, then gets mixed with others. Health scales between waves (a common starting point is around 10 to 15 percent more health per wave, or a flat step every few waves), while counts and spacing create the pressure. Put the table in a data file, not in code, so you and the agent can rebalance by editing numbers. The difficulty curve guide explains how to space new enemy types across a map.

Tip

Show the next wave before it starts: an icon of the enemy types and a “send early” button that pays a small bonus. It turns waiting into a decision.

Tower roles that counter enemies

Five or six towers is plenty. What matters is that each answers a question the wave table asks:

  1. 01Single-target damage (archer, gun): high damage per hit, good against tough single enemies, weak against swarms.
  2. 02Splash (cannon, mortar): lower damage spread in a radius, the answer to swarms, often slow to fire and unable to hit air.
  3. 03Slow / control (frost, glue): little or no damage, slows enemies by 30 to 50 percent in range. Multiplies every other tower’s effectiveness.
  4. 04Anti-armor (magic, laser): ignores or shreds armor, the answer to the Shellbacks.
  5. 05Anti-air: fast projectiles that can target flyers, the only answer to Gliders if your others are ground-only.
  6. 06Support (optional): boosts range or fire rate of towers nearby, rewarding layout planning.

Upgrades are where depth comes from. Two or three upgrade levels per tower, with a branch at the last level (more range or more damage, splash radius or burn) gives players something to plan for. Add targeting modes (first, last, strongest, closest) as a tap on the tower; “strongest” on a sniper tower is a small feature players notice and value.

The economy, and the one number to watch

  • Starting gold: enough for two basic towers. One feels stingy, three makes wave 1 trivial.
  • Bounty: gold per kill, scaled roughly with enemy health so tough enemies are worth more.
  • Wave clear bonus: a flat amount at the end of each wave, so a player who is barely holding on still progresses.
  • Selling: refund 60 to 75 percent of what the tower cost. Full refunds remove any cost to experimenting; zero refund punishes it.
  • Lives: 20 is the familiar default. Bigger enemies should cost more lives when they leak.

The balancing number is damage per second per gold spent, measured against the enemy type it is meant for. Calculate it for each tower and upgrade level in a simple table. If the basic archer gives 2 DPS per 10 gold and the upgraded cannon gives 5 DPS per 10 gold against everything, players will build only cannons. Slows are the exception: they do no damage but should feel worth their price because everything else hits slowed enemies for longer.

The brief to paste

A 2D tower defense game played on a single hand-drawn garden map, portrait for phones. Beetles walk a winding fixed path from the shed to the vegetable patch; each one that gets through costs a life (20 lives). Four towers on fixed build spots: Pea Shooter (single target), Seed Mortar (splash, ground only), Frost Mint (slows 40 percent, no damage) and Dragonfly Nest (hits flyers and ground). Each tower has two upgrades. Tap a tower for its range circle, upgrade, sell (70 percent refund) and targeting mode (first, strongest, closest). Waves come from a data file with enemy type, count, spacing, health and bounty; write 15 waves that introduce armored beetles at wave 3, a swarm at wave 5, flyers at wave 6 and a boss at wave 10 and 15. Show the next wave’s enemies with a Send early button. Add a 2x speed toggle. Win screen with stars by lives left.

Readability on a small screen

Tower defense gets busy fast, and phones make it worse. Keep enemy silhouettes distinct by role (armored enemies look chunky, flyers cast a shadow), give each tower a different projectile, and use health bars only on enemies that have taken damage. Show a range circle while placing and when a tower is selected, never all the time. A 2x speed button is close to mandatory: experienced players want early waves to pass quickly. On Startbase you can drag build spots and path decorations in the World Editor, and change the HUD (gold, lives, wave counter, speed button) by hand in the UI Editor. The game UI and HUD guide covers what to show and hide when the screen gets crowded.

Balance traps to test for

  • One tower to rule them all. Play a full run building only one type. If you win, that tower is too strong or the waves do not test its weakness.
  • Splash scaling. Splash damage multiplies with enemy count, so late swarm waves can make splash towers absurdly efficient. Cap targets hit or make late swarms armored.
  • Slow stacking. Several slow towers stacking to a near-freeze trivializes everything. Use the strongest slow, do not add them.
  • Dead time. If players wait more than a few seconds between waves with nothing to decide, shorten the gap or add the send-early bonus.
  • Boss leaks that end the game. A boss that costs all lives in one leak feels unfair. Make it cost 5 or 10.

Use checkpoints liberally while balancing: save a version, try a bold rebalance, and roll back if it plays worse. When it holds up, publish it and share it with the community. To find players beyond the community, see how to get players for your game.

Frequently asked questions

How many waves should a tower defense level have?

Somewhere between 15 and 40 is typical. A first map with 15 to 20 waves that introduce each enemy type and end on a boss is a good scope.

How do I balance tower defense towers?

Compare damage per second per gold spent against the enemy type each tower is meant for, and play full runs using only one tower type. If any single tower wins alone, nerf it or add waves that punish it.

Can a tower defense game work on phones?

Yes, especially with a fixed path and build spots instead of free placement. Keep tap targets large, show ranges only when relevant and test on a real phone screen.

On this page

  • Fixed path or open field
  • Write the wave table
  • Tower roles that counter enemies
  • The economy, and the one number to watch
  • The brief to paste
  • Readability on a small screen
  • Balance traps to test for

Keep reading

More in Games
Editorial ink illustration of a wooden toy figure jumping between two stone ledges, the coin above the gap in ember orange
GamesNovember 22, 2026

How to Make a Platformer Game with AI

A platformer lives or dies on its jump. Here are the numbers behind a jump that feels fair, how to build levels around it, and how to get an AI agent to build both.

7 min read
Editorial ink illustration of a tin wind-up runner on track pieces laid down ahead of it, the next track piece in ember orange
GamesNovember 22, 2026

How to Make an Endless Runner Game

An endless runner is a level generator with a character on top. Get the chunks, the speed curve and the controls right and the rest is art.

6 min read

Read less. Ship more.

Everything in this post is one prompt away. Describe your app and watch it build.

Start building

Apps, games, backends and publishing from one conversation.

Product

  • Features
  • Use cases
  • Pricing
  • Changelog

Resources

  • Blog
  • Docs
  • Support
  • Status
  • Security

Contact

  • w@startbase.ai
  • X / Twitter
  • LinkedIn
  • Instagram

Legal

  • Terms
  • Privacy

© 2026 Startbase. All rights reserved.