I made a game

jasonleow • 1 Mar 2025 •
Fk me… Did Claude Sonnet 3.7 just one shot a space invaders game?!
Inspired by @levelsio’s flight sim game, I tried making a Space Invaders-inspired game using AI. Thought it was also a good opportunity to test out Anthropic’s new Claude Sonnet 3.7 model.
And guess what - it generated workable code in one shot!
Plain HTML, CSS, JS.
A single index.html file.
Under 30min of vibe coding.
In fact, making the meta image assets took longer than Claude generating the code. The irony.
Play it here – jasonleow.com/space-defenders
So far I have so far not even won the stage 😅
The post title says I made a game.
But did I really? 🤔
—
🚧 Work-in-progress update: Making a 2-player version now!
Comments
@jasonleow It just needs some pew pew sounds.
@therealbrandonwilson Basically you prompt, asking for a complete working webpage that does x, and it should generate the HTML. Copy-paste the code into a text editor and save it as “index.html”. Then upload it to a web host.

Love it! What would make it sticky is possibly a leaderboard where groups of people can challenge each other. Block Blast is an addictive game, but competing with my daughters made it more exciting to play.
@therealbrandonwilson It might help to know that AI is referencing (and copying) existing code that does something similar to this. Space invaders, flight simulators (or moving 3D objects), tic-tac-toe, blogs, task managers, calendars, etc. have plenty of code out there offering this functionality, so the AI generates the code based on code already available. But it can build on that and make adjustments.
@therealbrandonwilson If you prompt the AI to generate everything in a single index.html file (ask AI what that is), then just uploading it to https://tiiny.host is sufficient to host it on the internet!
@Winkletter Good idea! Giving me ideas about making the aliens and fighters more Star Wars-like!
@haideralmosawi Yes, in the works now! I found a way to save a leaderboard… also made a 2-player but connection issues

@jasonleow This is a good lesson on how a game can pull the player in to a non-optimal strategy. For this game, the best strategy is to clear columns on one end of the alien horde. This increases travel distance and the aliens take longer to move down.
But, my first instinct is to sit in the middle and shoot because its easier to get to those aliens. It’s a reminder that some games and systems might have a filtering function, something that catches most people in a sub-optimal strategy. Then system seems rigged, but really, winning the game means figuring out how the game really works.

@Winkletter I’ll try that strategy! Someone had another high score one tactic where he shot a hole through the walls and was protected while he can shoot all he wants

I’ll try that strategy. Thanks! And damn you for wasting my time! 🤣😜

I made it past level 1. Pretty tough. I still don’t know how you guys are doing stuff like this. How do you go from prompts in the AI to the finished product? I’m missing those steps.