Live data from Hacker News

Show HN: I AI-coded a tower defense game and documented the whole process

github.com

151–160 of 163 posts

Re: Show HN: I AI-coded a tower defense game and documented the whole process

#151

Earlier quoted context omitted.

I've come to this same conclusion pretty strongly in the past few months in particular. I actually had negative comments on my experience with AI previously. 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 al…

How do you integrate it with your IDE? I have used intellij for 15 years, anything worse than it's actually code-aware auto complete feels like a downgrade. ie. hallucinating APIs feels totally unnecessary when my old IDE never did that. If our projects had an orderly structure, some test coverage and a reasonable way to manage database migrations, I might let the AI a lot more loose, but alas.

I use intellij. Latest versions have claude 4 as an option to enable. I almost exclusively use the code aware chat function rather than allow the ai to suggest changes as i type and i use the ability to merge changes from the ai chat window to bring things across as the responses are generated.

This leaves the autocomplete untouched. Basically it’s a way of working where the ai only jumps in when asked. It works really really well.

Re: Show HN: I AI-coded a tower defense game and documented the whole process

#152
Fun game!

In the old days, code reuse was an aspirational goal. We had collections of functions, libraries, etc., but the overhead of reusing specific lines of code, or patterns of lines of code, was too burdensome to be practical. Many tutorials have been published on how to create a tower defense game, meaning there are tons of sample code out there for this domain.

I would ask that given the amount of source material available, when when ask an LLM to generate code, is this really "AI" of any sort, or is it really a new kind of search?

Re: Show HN: I AI-coded a tower defense game and documented the whole process

#153
post #30

I'm really enjoying reading over the prompts used for development: ( https://github.com/maciej-trebacz/tower-of-time-game/blob/ma... ) 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…

I totally agree! this is the idea behind my recent post actually[1] where I recommend people use AI to write specs before they code. If all you have to do is a human is edit the spec, not write it from scratch, you're more likely to actually make one. [1] https://lukebechtel.com/blog/vibe-speccing

Heh, didn't know there was a name for it...

What I've taken to lately is getting the robots to write "scientific papers" on what I want them to get up to so instead of iterating over broken code I can just ask them "does this change follow the specification?" Seems to stop them from doing overly stupid things...mostly.

Plus, since what I've been working on is just a mash-up of other people's ideas, it provides a good theoretical foundation of how all the different bits fit together. Just give them the paper you've been working on and some other paper and ask how the two can be used together, a lot of the time the two ideas aren't compatible so it saves a lot of time trying to force two thing to work when they really shouldn't. Very good way to explore different ideas without the robots going all crazy and producing a full code project (complete with test and build suites) instead of just giving a simple answer.

Re: Show HN: I AI-coded a tower defense game and documented the whole process

#154

Earlier quoted context omitted.

I totally agree! this is the idea behind my recent post actually[1] where I recommend people use AI to write specs before they code. If all you have to do is a human is edit the spec, not write it from scratch, you're more likely to actually make one. [1] https://lukebechtel.com/blog/vibe-speccing

Heh, didn't know there was a name for it... What I've taken to lately is getting the robots to write "scientific papers" on what I want them to get up to so instead of iterating over broken code I can just ask them "does this change follow the specification?" Seems to stop them from doing overly stupid things...mostly. Plus, since what I've been working on is just a mash-up of other people's ideas, it provides a good…

there is now I suppose! ;)

Yeah it isn't a panacea but it has afforded me less frustration than the alternative of jumping straight in.

> Since what I've been working on is just a mash-up of other people's ideas

Totally, I find most work I do, if I'm honest, is in this bucket. LLMs are pretty good at "filling in the gaps" between two ideas like this

Re: Show HN: I AI-coded a tower defense game and documented the whole process

#155
post #6

This is awesome. I've been in software for 20+ years now as well. 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 t…

This post was interesting to me because I also have a lot of programming experience but other than hunt the wumpus high school I haven’t programmed a game and recently started using AI to help with a new game. 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 ans…

Sorry for the pedantry, but there's little evidence to suggest that neural nets know about unknown unknowns. They know a lot about known unknowns though. Really enjoyed your comment in any case :)

Re: Show HN: I AI-coded a tower defense game and documented the whole process

#156
post #155

Earlier quoted context omitted.

This post was interesting to me because I also have a lot of programming experience but other than hunt the wumpus high school I haven’t programmed a game and recently started using AI to help with a new game. 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 ans…

Sorry for the pedantry, but there's little evidence to suggest that neural nets know about unknown unknowns. They know a lot about known unknowns though. Really enjoyed your comment in any case :)

No worries and thanks. For clarification, unknown unknowns was in reference to my own understanding of subjects.

Re: Show HN: I AI-coded a tower defense game and documented the whole process

#157
post #30

I'm really enjoying reading over the prompts used for development: ( https://github.com/maciej-trebacz/tower-of-time-game/blob/ma... ) 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…

> No security holes. No bugs. A friend called me for advice on trouble he was having with an LLM and I asked “What exactly do you want the LLM to do?” He said “I want it to knock this project out of the park.” And I had to explain to him it doesn’t work that way. You can’t just ask for perfection. I mean, you can, but you won’t get it.

Writing tests and/or PRDs helps. Gives llms tangible direction that can be quantified.

Re: Show HN: I AI-coded a tower defense game and documented the whole process

#158
I am more interested in what this article and project does not seem to mention.

> During this process I've learned a lot

Yes, but what exactly? I mean I guess you don't have to touch the project once its finished so there is less value in familiarizing yourself with the source. The source is roughly 15135 lines. That is quite a chunk and most likely would have taken more than 30 hours to write that from an standpoint of knowing the basics of typescript and the phaser library.

Re: Show HN: I AI-coded a tower defense game and documented the whole process

#159

I am more interested in what this article and project does not seem to mention. > During this process I've learned a lot Yes, but what exactly? I mean I guess you don't have to touch the project once its finished so there is less value in familiarizing yourself with the source. The source is roughly 15135 lines. That is quite a chunk and most likely would have taken more than 30 hours to write that from an standpoint…

I’ve put some of the things I’ve learned in the README, but in general I feel more familiar with how Phaser works, how to achieve different outcomes, how to properly prompt the agents to get good results when making a game, and what to watch for when creating more complex game systems. The tutorial system in general proved to be challenging and if I had to make it again I would be more specific in how exactly it should be architected.

Re: Show HN: I AI-coded a tower defense game and documented the whole process

#160

Earlier quoted context omitted.

I have a reasonably good solution for this project of mine you might find useful: 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.

hidden input box is something I heard before from some hacker-ish old collegues - seems to be a powerful and reliable approach to store state & enable communication between components!

Oops, I worded my comment poorly -- it's not a hidden input, but rather a "CSS-visibility-hidden textbox input". Hidden inputs are useful but something completely different.
Post reply on HN