Live data from Hacker News

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

github.com

41–50 of 163 posts

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

#42

After scanning through the video, the first 20 minutes is a guy doing coding with no AI involved. He's manually designing a level in a pre-made level editor. He's manually writing code in a pre-made IDE. He's not having AI 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…

Congratulations, you've managed to spot all the pain/weak points of the whole ~30 hour process without ever noticing all the good points. It takes a special type of skill to do so :).

> About what I expected.

But then again, you opened the video already with an expectation to see failure, so of course you found it.

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

#43
post #32
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 tried to build a simple static HTML game for the board game Just One, where you get a text box, type a word in, and it's shown full screen on the phone. There's a bug where, when you type, the text box jumps around, and none of the four LLMs I tried managed to fix it, no matter how much I prompted them. I don't know how you guys manage to one-shot entire games when I can't even stop a text box from jumping around t…

Browser text entry on mobile phones is notoriously hard to get right and some bugs are literally unfixable [1]. I'm a frontend developer in my day job and I struggled with this even before AI was a thing. I think you just accidentally picked one of the hardest tasks for the AI to do for you.

[1] Example: https://www.reddit.com/r/webdev/comments/xaksu6/on_ios_safar...

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

#44
post #43
post #32

Earlier quoted context omitted.

I tried to build a simple static HTML game for the board game Just One, where you get a text box, type a word in, and it's shown full screen on the phone. There's a bug where, when you type, the text box jumps around, and none of the four LLMs I tried managed to fix it, no matter how much I prompted them. I don't know how you guys manage to one-shot entire games when I can't even stop a text box from jumping around t…

Browser text entry on mobile phones is notoriously hard to get right and some bugs are literally unfixable [1]. I'm a frontend developer in my day job and I struggled with this even before AI was a thing. I think you just accidentally picked one of the hardest tasks for the AI to do for you. [1] Example: https://www.reddit.com/r/webdev/comments/xaksu6/on_ios_safar...

Huh, that's actually my exact bug. I didn't realize this was so hard, thank you.

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

#45
post #40

Earlier quoted context omitted.

> 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 This has worked extremely well for me.

I wrote a whole PRD for this very simple idea, but still the bug persisted, even though I started from scratch four times. Granted, some had different bugs.

I guess sometimes I have to do some minor debugging myself. But I really haven't encountered what you're experiencing.

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?

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

#46
post #40

Earlier quoted context omitted.

I wrote a whole PRD for this very simple idea, but still the bug persisted, even though I started from scratch four times. Granted, some had different bugs.

I guess sometimes I have to do some minor debugging myself. But I really haven't encountered what you're experiencing. 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?

No, that's why I started again, because it's a fairly simple problem and I was worried that the context would get saturated. A sibling commenter said that browser rendering bugs on mobile are just too hard, which seems to be the case here.

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

#47
post #32
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 tried to build a simple static HTML game for the board game Just One, where you get a text box, type a word in, and it's shown full screen on the phone. There's a bug where, when you type, the text box jumps around, and none of the four LLMs I tried managed to fix it, no matter how much I prompted them. I don't know how you guys manage to one-shot entire games when I can't even stop a text box from jumping around t…

CSS is the devil and I fully admit to burning many hours of dev time, mine without an LLM, an LLM by itself, and a combination of the two together to iron out similar layout nonsense for a game I was helping a friend with. In the end, what solved it was breaking things into hierarchical react components and adding divs by hand and using the chrome dev tools inspector, and good old fashioned human brain power to solve it. The other one was translating a python script to rust. I let the LLM run me around in circles, but what finally did it was using Google to find a different library to use, and then to tell the LLM to use that library instead.

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

#48
post #32

Earlier quoted context omitted.

I tried to build a simple static HTML game for the board game Just One, where you get a text box, type a word in, and it's shown full screen on the phone. There's a bug where, when you type, the text box jumps around, and none of the four LLMs I tried managed to fix it, no matter how much I prompted them. I don't know how you guys manage to one-shot entire games when I can't even stop a text box from jumping around t…

CSS is the devil and I fully admit to burning many hours of dev time, mine without an LLM, an LLM by itself, and a combination of the two together to iron out similar layout nonsense for a game I was helping a friend with. In the end, what solved it was breaking things into hierarchical react components and adding divs by hand and using the chrome dev tools inspector, and good old fashioned human brain power to solve…

I didn't realize this was so hard, thanks. I expected to be simple positioning issues, but the LLMs all found it impossible.

Here's the game, BTW (requires multiple people in the same location): https://home.stavros.io/justone/

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

#49
post #44
post #43

Earlier quoted context omitted.

Browser text entry on mobile phones is notoriously hard to get right and some bugs are literally unfixable [1]. I'm a frontend developer in my day job and I struggled with this even before AI was a thing. I think you just accidentally picked one of the hardest tasks for the AI to do for you. [1] Example: https://www.reddit.com/r/webdev/comments/xaksu6/on_ios_safar...

Huh, that's actually my exact bug. I didn't realize this was so hard, thank you.

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.

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

#50
That's pretty impressive and super motivating. Love that you documented the prompts. From my experience "vibe coding" can either speed you up or slow you down. As long as you are using succinct and clear instructions and know how to review code quickly, as well as understand the architecture you can really speed up the process
Post reply on HN