I’m Building a Game with AI and You Can Too!
When people ask me what the best way to build and teach AI literacy, my answer is always something along the lines of “find a project that seems interesting to you and start experimenting!”
Of course, this all-too-simple recommendation comes with important caveats. You need to do your research. Understand biases and pricing structures. Think carefully about security, especially if you are working with sensitive data or giving an AI tool access to your applications or computer.
I’ve decided to take up my own advice and started building a tower-defense style video game using Replit.
Check out my overview of how to get started with Replit here: youtube.com/watch?v=PEaJnHpQf3E
While a previous article of mine focused on building prompts to create initial gamified learning experiences within LLM tools like ChatGPT, this article explores how I started building a standalone game using AI-assisted coding.
I want to outline exactly how I got started building the game, some lessons learned along the way, and why I believe building something yourself is the fastest way to truly understand AI.
Press enter or click to view image in full size
Starting with a vision
When building anything with AI, not just a cool video game, the process should always begin with scoping the project — what do you want to create?
For me, I had a vague sense of what I wanted to build.
Growing up, I spent too many hours playing various tower-defense games. The premise is fairly simple — enemies traverse a set path and the player’s objective is to build defense towers (usually cannons, catapults, etc) to defeat the enemies before they reach the end of the path.
My vision was flipping this idea a bit on its head. In my game, I wanted the players to build the paths, and the goal would be to defend the path from the enemies. I settled on a naval theme and the path being defended would be made by establishing trade routes that give the player money to build defenses and more trade routes.
The first prompt
When building any project with AI, pay particular attention to your first prompt. It sets the entire framework for the initiative.
I highly recommend meta-prompting — using LLMs like ChatGPT to help you create the structured prompt to build the first iteration of the game or project.
In that initial work with the LLM, it can be helpful to refine the idea, scope initial deliverables, gameplay or workflows, and conclude by building a prompt together.
Finish conversation with something like:
“Based on this agreed V1 scope, generate a structured Replit prompt that I can use to direct an AI coding agent to build the first playable version of the game.”
The entire prototyping conversation may look something like this:
https://docs.google.com/document/d/1yxNLL3XqwlyyC2N5zOGLoP1qb3iTUkGKbMnmmNUL0os/edit?usp=sharing
Build, Iterate, and Refine Cycle
Like any AI output, the first iteration of the project is rarely its final form.
But we’ve really come a long way (in a short time!) with AI-powered coding, and right from the first prompt, the game was somewhat playable. It wasn’t particularly fun and had plenty of bugs, but I was thrilled just to be able to click around, build a trade route, and watch enemies attack my defenses.
But now comes the hard part: How do I make this game into something people will actually enjoy playing?
Finding and remediating the early bugs was the easy part. Replit agent powered by Claude Opus-4.6 is remarkably good at understanding natural language and translating your prompts into code edits.
Some early prompts I used to debug:
Update movement logic so all boats (defense and enemy) treat islands as solid obstacles. Boats must never travel over land and should automatically path around islands using water-only routes.
and
The bottom menu is being cut-off. Reduce unnecessary padding/margins and ensure the full menu fits within the viewport. Keep layout changes minimal and adjust only what’s needed to prevent clipping.
An early mistake I made was over-explaining and building large debugging prompts using meta-prompting. While my intent was to be specific and efficiently squash bugs, this approach actually over complicated the process and led to increased token usage AKA was unnecessarily expensive!
Once the initial MVP was playable and mostly bug-free, I started adding some new features and worked on balancing the game mechanics.
The cannons were too powerful, so let’s decrease their range. The enemies are too weak… and now they’re too strong…
I started adding music and sound effects. I wanted little icons to appear when you gain gold and messages when you complete levels. Turns out there are LOTS of decisions to make when building a game. The judgment I use in making these choices will dictate how the game unfolds. And this is only the initial prototype!
I have big plans for Naval Defense (including finding a better name!) I want to build new unlock systems, exploration modes, a layered story, and escalating difficulty. The ideas are not the problem. The real challenge is structuring the iterations in a way that makes sense. Deciding what to build next and knowing what to cut. And most importantly, finding ways to make the game more fun!
That’s the human part.
Final Note
When thinking about building your first game or project, the right AI choice can make a big difference. Here is a painfully brief list of some popular tools for building apps:
Lovable — Pure text to app prototype in your browser (lowest learning curve).
Replit — Build and deploy from your browser with more control over the code (medium learning curve).
Cursor — Download to your computer and build together with an AI coding partner (steepest learning curve).
Try out the current version of Naval Defense here: https://navy-defense.replit.app/