Shiny Gen / Blog

How to make a tower defense game with AI (a real Game Boy Advance test)

Also in: Español · Deutsch · Français · Português · Italiano · Nederlands · Svenska · Norsk · Bahasa Indonesia · Türkçe · Polski · Tiếng Việt · Русский · 日本語 · 한국어 · 繁體中文

To make a tower defense game with AI, open Shiny Gen, start a new game on the GBA Engine, and describe it in the Agent tab: the map and the path, how you build towers, each tower and enemy, the waves, money and lives, and how you win. The AI agent builds the game for the Game Boy Advance, plays it and fixes what it finds, and you download the ROM. We did that for this guide. Six messages gave Tower Defense: slimes, beetles and knights walking a winding dirt path from a cave to a castle gate, a cursor to build, sell and upgrade towers, arrow, cannon, frost and lightning towers, coins, ten lives and ten waves, with title, game over and win screens. It took about 23 minutes of agent time and about 135 gems.

Tower Defense on the Game Boy Advance: a green meadow with a winding dirt path from a stone cave on the left to a red brick gate on the right, two towers with red roofs beside the path, a row of yellow sparks along the path from a lightning hit, and COIN 793, LIFE 10, WAVE 4 /10 and the controls at the top.
Wave 4 in the agent's own play-test: the lightning tower's sparks along the path.

The test: six messages, one tower defense game

We started a new game on the GBA engine, typed one detailed prompt, said "continue" three times, asked for one change and said "continue" once more.

MessageWhat we typedAgent timeGems
1The prompt belowabout 14 min10
2"continue"2 min 22 s26
3"continue"1 min 20 s23.9
4"continue"10 s2.7
5A lightning tower and upgrades3 min 0 s40.1
6"continue"1 min 41 s32.2

That is about 23 minutes of agent time and about 135 gems. The first message's line under it was out of view, so its time is our recording's and its 10 gems come from the gem count.

Step by step: the tower defense game we made

1. Start a GBA game

Press +, choose New, pick Custom for a game of your own, then pick GBA Engine on the Choose an engine screen. In a browser, this link opens a new GBA game directly. The Agent tab is where you talk to the AI.

2. Describe the map, the towers and the waves

A tower defense game is a list of rules, so write them all down: the path, how you build, each tower, each enemy, the waves, the money and the lives. We typed:

Make a tower defense game for the Game Boy Advance with real pixel art. Enemies come in waves along a winding dirt path through a grassy meadow, from a cave on the left to a castle gate on the right. Move a cursor with the D-pad and press A on a grass tile next to the path to build a tower, if you have enough coins; press B on a tower to sell it for half. There are three towers: an arrow tower that is cheap and fast, a cannon that is slow but hits a small area, and a frost tower that slows enemies. Enemies are slimes, fast beetles and slow armored knights, and each one that reaches the gate costs a life; you start with 10 lives. Defeating enemies gives coins. Press Start to send the next wave early. Show coins, lives and the wave number at the top. Ten waves, getting harder, and you win after wave 10. Draw all the art yourself as code: the meadow, the path, the cave and the gate, each tower, each enemy and the arrows and cannonballs. A title screen, a game over screen, a win screen, sounds for building and hits, and a marching tune.
The first prompt typed into the Agent tab of a new GBA game in Shiny Gen.
The first prompt, in the Agent tab.

3. The first message: the map, the path and the first fixes

The agent drew the meadow, the towers and the enemies, wrote the game in three files (the screens, the path and the waves, and the fighting), and built it. The dirt path did not show at first; the agent found that its background picture had been stretched to fit the screen, redrew it at the size it is shown at, and checked the path, the cave and the gate in a screenshot. It placed an arrow tower and a cannon, saw five of six enemies get through, and made the early waves fairer.

The first message then paused, with this note in the app: "The agent has taken 30 steps on this message and is still going (10.0 gems so far)... Free accounts pause every 30 steps. Any purchase removes this pause." Our recording account had not bought anything. Our next message, "continue", carried on.

Tower Defense's title screen: TOWER DEFENSE and PRESS START over the meadow, the winding path, the cave on the left and the gate on the right.
The title screen over the meadow.

4. "continue": all ten waves, then harder

With the first "continue" the agent played all ten waves to the win screen, and the game over screen too, then said the waves were too easy:

In every run I checked, all ten waves were cleared with no lives lost.

With the second it made the late waves tougher and played again: with three towers, lives went 10, 9, 5 and 1 over waves 7 to 10 and it lost at wave 10 with over a thousand coins unspent, so winning needs more towers. With the third it tested the frost tower in a fight: hit enemies slowed down for 120 frames.

Tower Defense's game over screen: GAME OVER and PRESS START over the meadow and the path.
Game over, in the agent's harder test.

5. Ask for the next change

Add a fourth tower, a lightning tower that hits several enemies in a chain, and let me upgrade a tower once by pressing A on it.

The agent added the lightning tower (50 coins; it hits the nearest enemy, then jumps to up to three more) and an upgrade for any tower (30 coins: more range, twice the reload speed and a gold-trimmed look). It tested the chain with three enemies side by side: one shot hit all three. The last "continue" added flickering sparks along each jump, so you can see the chain, and it played to the win screen with four towers and all ten lives left.

Tower Defense's win screen: YOU WIN and PRESS START over the meadow.
The win screen after wave 10.
The agent's last message: still open, the bolt is a row of small flickering dots, not a drawn line, and the enemies and towers are still simple shapes drawn in code; Worked for 1m 41s, 32.2 gems.
What the agent said was still open.

6. Play it and download the ROM

The game plays in the editor and from its card: on-screen buttons on a phone, the keyboard or a controller on a computer. The D-pad moves the cursor, A builds on grass beside the path or upgrades a tower, B sells a tower, L and R switch between the four towers, and Start begins a game, sends the next wave early and restarts. Press Share, then Export .gba ROM to download the cartridge. Exporting is included with any purchase. The ROM guide covers emulators and flash carts.

What we learned from the test

What to put in a tower defense prompt

Ideas to ask for next

FAQ

Can AI make a tower defense game?

Yes. Describe the path, the towers, the enemies, the waves, the money and the lives, and Shiny Gen's agent builds it for the Game Boy Advance and plays it. Ours took six messages, about 23 minutes of agent time and about 135 gems.

Can I make it for the browser instead?

Yes. Pick the Godot engine on the same screen for a tower defense game that runs in the browser and on phones. We made this one for the GBA.

Is it a real .gba ROM?

Yes. It is a Game Boy Advance cartridge image compiled to the machine's own code, and you can download it. We have played GBA ROMs made this way on real hardware through a flash cart, but not this game; any GBA emulator opens it.

Is it free?

Making, playing and sharing games is free. The built-in agent uses gems, and new accounts get free gems. Exporting a game as a file is included with any purchase. See the pricing page.

Shiny Gen is not affiliated with or endorsed by Nintendo. Game Boy Advance is a trademark of Nintendo. It is named here only to describe.

Last updated: December 3, 2026

Start makingDownload on the App StoreGet it on Google Play