How to vibe code a game with AI (from the idea in your head to the full game)
Also in: Português
To vibe code a game, you direct and an AI coding agent builds: you write one page about the game, pick tools the agent can run from text files, give it rules, ask for the smallest playable version in grey boxes, and then play, write notes and let it fix, over and over. Art, music, sound, voices and films come after the game is fun. Two real games show every step here: Broodfall, a tower defence roguelite on Steam, and Glorified, a horror game in Unity that is still in development. For the full story of one game, every failure included, watch the Glorified devlogs.
1. Start with one page
Broodfall's first design document was 1,217 words. Its pitch: a tower defence roguelite where you are the monster, an escaped bioweapon growing across a city of intelligent insects. "Towers are limbs, creep is skin, organs are the build, meat is the economy." Every decision the developer, Malcolm Collins, made after that went into the document with his name, the date and his own words. It is about 27,500 words today, and the agent reads it as the source of truth.
2. Pick a stack the agent can drive from text
- Broodfall: TypeScript, the PixiJS renderer and HTML for every menu. Its rule: "the whole game must be buildable and testable by an AI agent working in text files, with no human-only editor in the loop."
- Glorified: Unity 6, run from the command line in batch mode; the scenes are built from code, never by hand.
If the agent cannot run it and test it alone, pick something else.
3. Give the agent rules
Write them in a file the agent reads every session (for Claude Code: CLAUDE.md). Broodfall's first one: "don't tell me something is done until you have run thorough e2e tests as a player, I couldn't even start it." Glorified's: every mechanic gets a test, one Unity job at a time, every step ends with a note and pictures. When the agent makes the same mistake twice, write a rule.
4. Day one: grey boxes
Ask for the smallest version you can play today. Broodfall went from its design document at 10:23 to a playable slice at 11:00 the same morning, with an autoplayer and 16 tests. Glorified's plan said about four days for its first three steps; it took one day: tank controls, fixed cameras, three powers and a capsule that shoots back.
5. The loop: play, write notes, fix
Good notes say what you did, what you saw and what you expected. Glorified's notes from its second week: "her model slides back", "a box killed me for no reason", "the side dodge is hard to trigger". Each became a fix and a test.
6. Tests and a bot that plays
Broodfall has 75 test files and about 800 tests, including one with the designer's words in its name: "generally in a game wave one should be mostly or only war caste". Glorified's bot plays its whole tutorial before every push; the game runs more than 460 tests. But, as the Glorified devlog says: "a bot that passes is not a fight that feels good." Only you can tell if it is fun.
7. The biggest mistake: art too early
On Glorified's first night the agent built all nine characters in 3D: about $42, a third of it thrown away by morning. The real cost was attention. The rule since: grey boxes for the whole first play-through. Find the fun, then the art.
8. Art, 3D characters and textures
- Write the look down first. Broodfall's style bible has 33 numbered rules ("Insects are people").
- 2D art (Broodfall): a picture, a video loop whose last frame is its first, a keyer, a sprite sheet. About $1.70 a unit, $1.35 a limb, $3.80 a tile set; the board (26 units, 36 limbs, 8 tile sets) about $200.
- 3D characters (Glorified): one dead-front picture, 3D Studio, a texture, a rig and motions: about $2.80 a character. Let the agent solve the problems (clips that travel, a wrong forward axis, ghost teeth on a helmet).
- Textures: Nano Banana Pro drew real 2K surfaces for $0.32 each; mirror each tile to hide the seam.
9. Music, sound effects and voices
- Music: Broodfall's first soundtrack was 12 pieces from Eleven Music through RFab's Music Studio; later the developer put in his own songs. Glorified keeps placeholder tracks made in code.
- Sound effects: Broodfall's 42 effects (147 variants) came from a video model that makes its own sound: ask for the sound six separate times with a second of silence between, and throw the picture away. Glorified used free packs plus synthesis. RFab also has a sound effect API.
- Voices: a word in CAPITALS gets spelled out letter by letter, and a cloned voice does not follow acting directions. Design a voice when it needs to act.
10. Cutscenes, comics and AI in the game
- Films: Broodfall has 19, made by one command each. A whole exchange (up to 44 words) goes into one clip so the actors perform it, and every clip passes gates (words heard, nothing added, the right voice and face, no static or dead air). The first film cost $2.68.
- Comics: three comics the player earns; the four-page opening cost $2.49 on RFab's comic engine.
- AI in the game: Broodfall's ship AI, YOKE, talks with the player live through the RFab API, at about 2.5 cents an exchange. New players get $3 of free talk; then they link an RFab account.
11. Ship it
Broodfall's trailers are captured from the real game frame by frame, titles set in type. Its Steam page went live on November 4 and had about 430 wishlists two days later. Answer Steam's AI question honestly; Broodfall's page says it was built in part as a test of the RFab API.
What it cost
Broodfall's board art about $200, its recorded film and newsreel work about $150, the Steam fee $100; Glorified's eleven days of game art about $60. The biggest cost is your time playing the game.
Tips for beginners
- Ask for small steps, and play each one.
- Never trust "done": ask for a screenshot, a clip or a test result.
- Commit after every working step.
- When the agent fails the same way twice, write a rule.
- Play your own game early, while it is still ugly.
Want a full tutorial on one of these steps? Tell us in the video's comments.