Levelwick guide
How to make a tower defense game with AI
Build a working tower defense game with an AI game maker or chat assistant: a step-by-step prompt sequence, balance tips and fixes for common bugs.
Steps
- Define the path first. Write the enemy route as a fixed list of waypoints or a straight lane. Ask for the path to be drawn clearly and for enemies to follow it exactly.
- Ask for one tower and one enemy. Generate the smallest playable version: one tower type with a visible range, one enemy type, coins, lives and a Start Wave button.
- Check the core loop. Place towers, start a wave, and confirm towers shoot, enemies die, coins arrive and lives drop when enemies reach the end.
- Add tower variety. Add two more towers with distinct jobs, such as a slowing tower and an area-damage tower, each with a clear price.
- Script the waves. Ask for a wave list that adds enemies and speed gradually, with a tougher enemy type introduced mid-game and a boss at the end.
- Add feedback and polish. Request hit effects, floating coin text, a pause button, and sell/upgrade options for placed towers.
Why tower defense suits AI game makers
Tower defense has a small set of moving parts: a path, enemies that follow it, towers that target enemies in range, and an economy. Each part can be described in a sentence or two, which is exactly what AI game makers and chat assistants handle best. The hard part is not the code; it's the balance, and you can tune that yourself with a few targeted follow-ups.
Start with a fixed path
The most common failure is enemies wandering off the road or walking through scenery. Avoid it by describing the route precisely:
- A straight lane ("goblins walk from the right edge to the castle on the left"), or
- A list of waypoints ("the path goes from the left edge to (200,100), then (200,300), then the right edge").
If you want players to build mazes, say so and name the method: "enemies follow the shortest path, recalculated with breadth-first search; refuse a placement that would block the path."
Keep the first version small
Your first prompt should include one tower, one enemy, coins, lives and a Start Wave button. A good first prompt looks like:
Make a one-screen tower defense game. Slugs follow a winding path of 6 waypoints. Click a grass tile to place a Pea Shooter for 25 coins. Start with 100 coins, slugs give 5 coins, 10 lives. Show coins, lives and the wave number, and a Start Wave button. Draw everything with simple shapes.
Play it. Does the tower fire? Do coins go up? Does a slug reaching the end cost a life? Only when that works should you add more.
Give every tower one job
Three towers with distinct roles beat eight similar ones. A classic set is single-target damage, area damage and slowing. Put the price and effect in your prompt so the AI doesn't invent numbers you'll have to undo.
Design the difficulty, don't hope for it
Ask for a wave list: an array where each wave says which enemies come, how many, and how fast. Rising enemy health by 10 to 15 percent per wave is a reasonable starting point to test, then adjust by feel. Add a calm wave after every hard one; players appreciate a breath.
Common bugs and the fix prompts
- Towers shoot at enemies that are already dead: "When an enemy is removed, clear it from every tower's target and from in-flight projectiles."
- Enemies bunch into one dot: "Space enemies at least 30 px apart along the path when they spawn."
- Game gets slow in late waves: "Remove projectiles that miss or leave the screen, and reuse objects with a pool."
Polish last
Once the loop and balance feel right, add juice: hit flashes, floating "+5" coin text, a small shake when a life is lost, and a range circle when a tower is selected. These make a big difference to how finished the game feels.
FAQ
How many towers should my first version have?
One. Confirm the core loop works, then add a second and third tower with clearly different roles.
Why do enemies walk off the path?
Usually because the path wasn't defined precisely. Describe it as waypoints or a grid, and ask enemies to move from waypoint to waypoint.
How do I make it harder without making it unfair?
Raise enemy count, health and speed gradually through a wave list, and introduce new enemy types one at a time with a tower that counters them.
Can I use my own tower drawings?
Yes. Upload clean images with transparent backgrounds if your tool supports uploads, and make sure you own or have permission to use them.