Show HN: I AI-coded a tower defense game and documented the whole process
You can play it in your browser here: https://m4v3k.itch.io/tower-of-time
The goal of this project for me was first and foremost to see if AI coding is good enough to help me with creating something that's actually fun to play and to my delight is turns out the answer is yes! I decided to document the whole process for myself and others to learn from my mistakes, so both the code AND all the prompts I used are published on GitHub (see submission link). The art assets are largely taken from itch.io artists who shared them for free, with some slight touch ups. Sounds came from freesound.org.
I've also streamed parts of the process, you can watch me working on the final stretch and submitting the finished game (warning, it's 5+ hours long):
https://www.twitch.tv/videos/2503428478
During this process I've learned a lot and I want to use this knowledge in my next project that will hopefully be more ambitious. If you have any comments or questions I'm here to answer!
A lot of posts about "vibe coding success stories" would have you believe that with the right mix of MCPs, some complex claude code orchestration flow that uses 20 agents in parallel, and a bunch of LLM-generated rules files you can one-shot a game like this with the prompt "create a tower defense game where you rewind time. No security holes. No bugs."
But the prompts used for this project match my experience of what works best with AI-coding: a strong and thorough idea of what you want, broken up into hundreds of smaller problems, with specific architectural steers on the really critical pieces.
Where are you reading “a lot of posts” making this specific claim? I’ve never seen any serious person make such a claim
> a strong and thorough idea of what you want, broken up into hundreds of smaller problems, with specific architectural steers on the really critical pieces.
This is how I’ve been using LLM bots since CGPT preview and it’s been phenomenally useful and 100x my productivity
The gap seems to be between people who never knew how to build, looking for a perfect Oracle that would be like a genie in a lamp, then mad when its actual work
The thing the last few years have beat into me is that most engineers are actually functionally bad engineers who only know 1:1000th of what they should know in order to know how to build a successful project end to end
My assumption was that all of the bad engineers I worked with in person were a accidental sample of some larger group of really good ones (who I’ve also been able to work with over the years) and that it’s just rare to find an actual capable engineer who understands the whole process
Turns out that’s a trivial minority (like every other field) and most people are pretty bad at what they do
[1] Example: https://www.reddit.com/r/webdev/comments/xaksu6/on_ios_safar...
https://grack.com/demos/adventure/
The trick for me was just using a hidden input and updating the state of an in game input box. The code is ancient by today's standards but uses a reasonably simple technique to get the selection bounds of the text.
It works with auto complete on phones and has been stable for a decade.
This has worked extremely well for me.
I am on full-rework iteration three, learning as I go on what works best, and this is definitely the way. I'm going to be making a presentation to my team about how to use AI to accelerate and extend their day-to-day for things like this and here's my general outline:
1. Tell the LLM your overall goal and have it craft a thoughtful product plan from start to finish.
2. Take that plan and tell it to break each of the parts into many different parts that are well-planned and thoroughly documented, and then tell it to give you a plan on how to best execute it with LLMs.
3. Then go piece by piece, refining as you go.
The tool sets up an environment, gets the data from the warehouse, models it, and visualizes it in great detail. It took me about 22 hours of total time and roughly 2 hours of active time.
It's beautiful, fast, and fully featured. I am honestly BLOWN AWAY by what it did and I can't wait to see what others on my team do w/this. We could have all done the setup, data ingestion, and modeling, no question; the visualization platform it built for me we absolutely could NOT have done w/the expertise we have on staff--but the time it took? The first three pieces probably were a few days of time, but the last part, I have no idea. Weeks? Months?
Amazing.
Early on, I realized that you have to start a new "chat" after so many messages or the LLM will become incoherent. I've found that gpt-4.1 has a much lower threshold for this than o3. Maybe that's affecting your workflow and you're not realizing it?
Here's the game, BTW (requires multiple people in the same location): https://home.stavros.io/justone/
A technique that works well for me is to get the AI to one-shot the basic functionality or gameplay, and then build on top of that with many iterations.
The one-shot should be immediately impressive, if not then ditch it and try again with an amended prompt until you get something good to build on.
One thing I've noticed is many (most?) people in our cohort are very skeptical of AI coding (or simply aren't paying attention).
I recently developed a large-ish app (~34k SLOC) primarily using AI. My impression is the leverage you get out of it is exponentially proportional to the quality of your instructions, the structure of your interactions, and the amount of attention you pay to the outputs (e.g. for course-correction).
"Just like every other tool!"
The difference is the specific leverage is 10x any other "10x" tool I've encountered so far. So, just like every tool, only more so.
I think what most skeptics miss is that we shouldn't treat these as external things. If you attempt to wholly delegate some task with a poorly-specified description of the intended outcome, you're gonna have a bad time. There may be a day when these things can read our minds, but it's not today. What it CAN do is help you clarify your thinking, teach you new things, and blast through some of the drudgery. To get max leverage, we need to integrate them into our own cognitive loops.
AI has become three things for me:
(1) A learning tool. What it is really great at is understanding my questions when I don’t have the proper terminology. Because of this it can give me a starting point for answers. It is also really fantastic for exposing me to unknown unknowns; probably the most important thing it does for me.
(2) A tool to do boring or tedious things that I can do but slow me down. I’ve found it good enough at a variety of things like commenting code, writing a config file (that I usually edit), or other text-based adventures.
(3) Search. Just like (1), because it understands what I’m actually after, it is irrelevant if I know what a thing is actually called. I also let it filter things for me, make recommendations, etc.
I think you can let it think for you, but… why would you? It’s not as smart as you. It’s just faster and knows more things. It’s like an FPU for the CPU of your brain.
The reason for my skepticism is the delta between what they're being sold as and what they actually do. All AI solutions, including agents (especially agents!), are effectively worse-than-worthless without guidance from someone experienced. There's very little that's "autonomous" about them, in fact.
The very guy who coined the term "vibe coding" went on stage effectively saying we're putting the carriage before the horse!
Omitting the important caveat that while they are fantastic tools they need to be restrained a lot is effectively lying.
Like most things, the truth is somewhere in the middle. But unlike many things, they are changing and advancing rapidly, so it's current state is not the resting state.
One of the best comparisons to me is languages.
The old "lisp [or whatever] lets us do more, faster" idea, but with a fun twist where if you can reduce the code you write but still end up with generated code in a fast, high-performance language, without the extra work you would have to do to go add type annotations or whatnot everywhere for SBCL.
But with a gotcha that you are gonna have to do a lot of double-checking on some of the less-easily/obviously-verified parts of the generated code for certain type of work.
And of course highly-expressive languages have resulted in no small number of messy, unmaintainable codebases being built by people without well-specified advance plans. So we're gonna see a lot of those, still.
BUT to me the real, even bigger win - because I spend less time writing 100% new code than integrating old and new, or trying to improve old code/make it suit new purposes, is supercharged debugging. A debugger is a huge improvement over print statements everywhere for many types of things. A machine that you can copy-paste a block of code into, and say "the output looks like [this] instead of like [that], what's going on" and get a fresh set of eyes to quickly give you some generally-good suggestions is a huge improvement over the status quo for a lot of other things as well. Especially the type of things that are hard to attach a debugger to (sql, "infrastructure as code", build scripts, etc, just to start).
For all the talk of AI hitting a ceiling the latest tools have improved greatly. I'm literally doing things in hours that'd previously take weeks with little issue. I do of course have to think about the prompts and break it down to a fine grained level and i also have the AI integrated well with the IDE.
The biggest wins are the times you hit a new framework/library. Traditionally you'd go through the 'search for code samples on usage of new library/language/framework -> work those samples into a form that accomplishes your task' cycle. AI is much better for this to the extent it even often surprises me. "Oh the library has a more straightforward way to accomplish X than i thought!".
For those who are still skeptical it's time to try it again.
This is where I’ve found usefulness falling off. Code is much more succinct and exact than English. I was never slowed down by how fast I could type (and maybe some are? I’ve watched people finger type and use the mouse excessively) but by how fast I could understand the existing systems. By the time I could write an expressive prompt in English I might as well have made the changes myself.
I’ve found it enormously useful as google on steroids or as a translator (which many changes that require code often end up being).
What's an example of this? Some of the ones I see most are: converting legacy code to something modern, building a greenfield app or feature in an unfamiliar language / framework / space.
But at work I don't have these types of jobs, and I want to get this productivity speed up, but right now I'm stuck at it helps a lot but not turning weeks of work into hours, so trying to get there
I'm a mobile dev by trade. The best interaction i had recently was with Python and the Manim library specifically which are not my area of expertise. This was a series of "Create an animation that shows X with a graph of the result over variables Y". AI gave a one shot successful results with good coding practices for all of this. I could have spent a week coming up to speed on that library and re-remembering all the Python syntax or i could have fought against doing it at all but instead, one hour of prompting, "here it is boss, done".
I had similar results doing some updates to the app itself too fwiw. Android dev has a lot of boilerplate. "Create a new screen to show a list of images in a recycler view". Everyone who's done Android knows the boilerplate involved in what i just stated. Again 1 shot results. Unlike the above this is something i know how to do well, i just didn't want to type 100's of lines of boilerplate.
Couldn't say it better myself. I think many people get discouraged when they don't get good results without realizing that for good results you need to learn how to interact with these AI agents, it's a skill that you can improve by using them a lot. Also some AI tools are just better than others for certain use cases, you need to find one that works best with what you're doing.
When it finally clicks for you and you realize how much value you can extract from these tools there's literally no coming back.
I'd hope most devs are using AI heavily when coding, the last 6 months seem to have reached a level of competence in raw programming skill somewhere around mid- or senior- level with hilarious variance between brilliance and idiocy.
I think you might be seeing the most vocal programmers are terrified for their future prospects and there isn't much room to reason with them so they're let alone.
The first commit[0] seems to have a lot of code, but no `PROMPTS.md` yet.
For example, `EnergySystem.ts` is already present on this first commit, but later appears in the `PROMPTS.md` in a way that suggests it was made from scratch by the AI.
Can you elaborate a bit more on this part of the repository history?
[0]: https://github.com/maciej-trebacz/tower-of-time-game/commit/...
If you want to follow the history of this project as it was created the best way would be to read the prompts file from top to bottom. For example the EnergySystem.ts file was created right after I was done with enemy pathfinding, spawing and tower shooting and it was created from scratch by the AI using the prompt "I want to implement an Energy subsystem where..."
[1]https://colinmilhaupt.com/posts/responsible-llm-use/
It's a VS Code extension so I'm using it inside Cursor and depending on a task I would either use Cursor's Agent mode (for simpler, more constrained tasks) or Augment Code's (for tasks that span multiple files and are more vague and/or require more steps to finish).
There are downsides though - it's more expensive than Cursor ($50 vs $20 per month) and it can be unreliable - I'm frequently getting errors/timeouts that require hitting "Try again" manually, which is frustrating. I might switch to Claude Code after my plan runs out because I've heard many good things about it recently.
I stopped coding a long time ago. Recently, after a few friends insisted on trying out AI-Assistance codes and I tinkered. And all I came up was a Bubble Wrap popper, and a silencer. :-)
https://bubble-pop.oinam.com
https://void.oinam.com
As far as stats go from the provider dashboards I see:
- 7667 lines of Agent Edits accepted on Cursor
- 105 messages (prompts) on Augment Code
At the 20 minute mark, he decides to ask the AI a question. He wants it to figure out how to prevent a menu from showing when it shouldn't. It takes him 57 seconds to type/communicate this to the AI.
He then basically just sits there for over 60 seconds while the AI analyzes the relevant code and figures it out, slowly outputting progress along the way.
After a full two minutes into this "AI assistance" process, the AI finally tells him to just call a "canBuildAtCurrentPosition" method when a button is pressed, which is a method that already exists, to switch on whether the menu should be shown or not.
The AI also then tries to do something with running the game to test if that change works, even though in the context he provided he told it to never try to run it, so he has to forcefully stop the AI from continuing to spend more time running, and he has to edit a context file to be even more explicit about how the AI should not do that. He's frustrated, saying "how many times do I have to tell it to not do that".
So, his first use of AI in 20 minutes of coding, is an over two minute long process, for the AI to tell him to just call a method that already existed when a button is pressed. A single line change. A change which you could trivially do in < 5 seconds if you were just aware of what code existed in your project.
About what I expected.
> About what I expected.
But then again, you opened the video already with an expectation to see failure, so of course you found it.
Isolating your analysis of this to a single unflattering interaction is intellectually dishonest; you have a bone to pick.
[0] https://news.ycombinator.com/item?id=44463967#44465304
I came back here specifically to ask about Augment Code, after going to their website and not really understanding what it is