Skip to content
Loopfunder
Build a game with AI

How to Build a Game with AI

How to build a game with AI, step by step, covering game types, gameplay, lore, characters, branding and the tools that write the code and make the art.

By The Loopfunder Team · · 18 min read

You can now build a game with AI without being a programmer or an artist. AI tools write code from plain-language instructions, draw concept art, and help with story and characters. They do not decide what the game is or whether it is fun. That part is yours, and this guide is mostly about that part.

It walks through the whole process in order: choosing a game type, deciding how big the world should be, designing gameplay, writing lore, developing characters, branding the game, and then building, testing and sharing it. Each section has a prompt you can copy and a starter idea to try.

What AI can and cannot do for a game today

The honest picture, as of November 2026.

It can write a working small game. People are doing it in public. Wharton professor Ethan Mollick published a city-building game whose notes say it was "Built with Claude Code," with "no art assets — every stone, citizen, and sound is procedural." The creator of the Three.js library released a browser port of Quake credited "with @claude." In April 2026 the Vibe Jam competition required that "90%+ of the code must be written by AI."

It does not make the game good for you. A teacher who set students the task of vibe coding a game reported that the results "ranged from awful to bad," adding that "you still have to understand how something is built." AI will build exactly what you ask for, so what you ask for matters most.

Here is how the work divides.

Part of the game What AI does well What stays with you
Idea and design Offers options, spots gaps, drafts documents Choosing the idea and what to leave out
Code Writes and fixes most of it for small games Describing what you want, playing and judging
Art Concept images, simple sprites, textures A consistent style, picking what fits
Story and characters Drafts, names, variations Voice, taste, what the story is about
Game feel Adjusts numbers when told Knowing which numbers feel wrong
Testing Finds errors, runs checks Watching real people play

The term for building software by describing it to an AI is vibe coding. Our guide to the best vibe coding tools explains the options.

The process at a glance

  1. Choose a game type
  2. Decide between open world and something smaller
  3. Design the gameplay
  4. Write the lore
  5. Develop the characters
  6. Brand the game
  7. Build it with AI tools
  8. Test, share and find support

The first six steps are design. Do them in a day or a weekend, on one page, before you open a coding tool. They shape every instruction you give the AI later.

Step 1: Choose a game type

The type of game decides how much work it is. Some types are well within reach of one person with AI tools. Others are multi-year team projects whatever tools you use.

Game type What the player does Fit for a first AI-built game
Arcade or score chaser Dodge, collect, survive for a high score Excellent. One screen, one mechanic
Puzzle Solve self-contained challenges Excellent. Clear rules suit AI well
Platformer Run and jump through levels Good. Level design takes time
Top-down shooter or survivor Move, shoot, upgrade Good. Balance needs tuning
Idle or clicker Numbers go up, buy upgrades Good. Mostly logic and menus
Card or deck builder Play cards, build a deck Good. Lots of content to write
Visual novel or text adventure Read, choose, branch Good. Writing-heavy, light on code
Tower defence or small strategy Place units, manage resources Moderate. Many systems interact
Role-playing game Explore, fight, level up, follow a story Hard. Huge amounts of content
Online multiplayer Play with others over the internet Hard. Servers, cheating, cost
Open-world 3D Roam a large world freely Very hard. See the next step

Three rules for picking:

  • Choose a type you play. You will judge it better.
  • Choose one where a session lasts minutes. Short games are easier to finish and test.
  • Go single-player first. Multiplayer adds servers and a long list of new problems.
Prompt
I want to make my first game using AI coding tools. I have [hours per week] for [number of weeks], and my skills are [none / some coding / some art].

Games I love: [three games]
What I enjoy about them: [a sentence each]

Suggest five small game concepts I could finish in that time. For each, give the game type, the one core mechanic, why it suits a solo creator, and the biggest risk. Then recommend one and say why.

Step 2: Open world or not?

Many first-time creators picture an open world: a big map, freedom to go anywhere, things to find. It is the most appealing idea and the most expensive.

An open world multiplies the work. Every direction the player can go needs something worth finding. You need systems for saving, loading areas, maps, quests and travel. All of it must be tested in every order a player might try. AI tools can generate terrain and write the systems, but they cannot fill a world with things worth doing, and a large empty map is worse than a small full one.

Open world Linear levels Single arena or hub
Player freedom High Low Medium
Content needed Very large Moderate, and you control the order Small, reused
Testing Hard, many paths Easy, one path Easy
Risk of feeling empty High Low Low
Solo-friendly Rarely Yes Yes

What to build if you want the open-world feeling:

  • A small dense map. One island, one town or one building, packed with detail.
  • A hub with branches. A central area with short self-contained areas leading off it.
  • A world that changes, not grows. The same place by day and night, or across seasons.
  • Generated levels. Rooms or maps assembled by rules, so each run differs. AI is good at writing these rules.

Derek Yu, the creator of Spelunky, gives the general advice in his essay on finishing a game: "IF YOU DO QUIT, SCALE DOWN, NOT UP." Start with the small version. You can always make the next one bigger.

Prompt
My game idea is: [one or two sentences].

I am tempted to make it open world. Play devil's advocate. Describe three smaller structures that would keep the feeling I am after: a single dense area, a hub with short branches, and generated levels. For each, say what the player would do in the first five minutes, what I would need to build, and what I would lose compared with a full open world.

Step 3: Design the gameplay

Gameplay is what the player does and why it is satisfying. You do not need to be a trained designer. You need to answer three questions.

What is the core loop? The loop is the set of actions the player repeats. In a role-playing game it might be "explore, fight, upgrade." Write yours as three or four verbs. If the loop is dull, nothing built on it will help.

What should the player feel? A well-known design paper, the MDA framework, suggests working backwards from the experience. It names kinds of enjoyment a game can offer, among them challenge, discovery, fantasy, narrative and expression. Pick two.

What are the pillars? Pillars are the three things your game must do well. The team behind Unpacking settled on "contemplation, discovery, and expression," and cut whatever did not serve them.

Then set the basic rules:

  • What can the player do? List the actions.
  • What pushes back? Enemies, a timer, limited resources, a puzzle.
  • How do you win, and how do you lose?
  • What changes over time? New abilities, harder levels, more options.

Give the AI numbers, not adjectives. "The player moves at 6 units per second and can jump 2 units high" can be built and tested. "The player should feel nimble" cannot.

Then build only the loop, with plain shapes, and play it. This matters more than any other step in the guide. Ten minutes with a rough prototype will tell you more than a week of planning.

Prompt
Help me design the gameplay for this game: [one-line pitch].
Game type: [type]. Session length: [minutes]. Platform: [browser / PC / mobile].

Give me:
1. The core loop as three or four verbs.
2. The two feelings the player should have most often.
3. Three design pillars, each one sentence.
4. The player's actions, with starting numbers for speed, health and anything else that needs a value.
5. What opposes the player and how it gets harder.
6. Win and lose conditions.
7. The smallest prototype that would test whether the loop is fun, and what I should watch for when I play it.

Once you have answers, put them on one page. Our game design document template gives you the layout, plus a version formatted for AI coding tools.

Step 4: Write the lore

Lore is the background of your game's world: where it is, what happened, and why things are as they are. It gives the gameplay meaning. Collecting orbs is a mechanic. Collecting the last sparks of a dying sun is a reason to care.

Keep it in proportion. Fallout co-creator Tim Cain, as reported by Game World Observer, writes design documents in a fixed order: setting, then story, then systems. He describes most of his settings as "a thing that's very easy to explain, oh, but there's a twist."

That is a good target for a small game. Your lore needs:

  • A setting in one sentence. Familiar, with one twist.
  • A problem. What is wrong in this world when the game begins?
  • A reason for the gameplay. Why does the player do the thing the core loop asks?
  • Three or four details players will see: a place name, an object, a faction, a saying.

Then show it through the game. Players skip long text. They notice item names, the look of a level, a line of dialogue and what enemies do.

AI is a useful partner here. It can produce twenty setting ideas in a minute, name places in a consistent style, and write item descriptions by the dozen. Its first drafts tend to be generic, so give it your twist and ask for specifics. Keep a short "lore bible" file with the facts you settle on, and paste it into every writing request so details stay consistent.

Prompt
Write the lore for my game. Keep it short and specific, and avoid generic fantasy and sci-fi clichés.

Pitch: [one line]
Core loop: [verbs]
Tone: [two or three words]
The twist I want: [what makes this world different]

Give me:
1. The setting in one sentence.
2. What went wrong in this world, in three sentences.
3. Why the player does what the core loop asks.
4. Five place names and five item names in a consistent style.
5. Six one-line item descriptions that hint at the history without explaining it.
6. A list of facts to keep consistent, formatted as a lore bible I can paste into future requests.

Step 5: Develop the characters

Players remember characters longer than mechanics. Even a small game gains from a lead character with a clear look and a clear want.

For each important character, settle five things:

  1. What they want. One sentence. This drives the story.
  2. What stands in the way. The source of conflict.
  3. A flaw or quirk. What makes them a person and not a role.
  4. How they look at a glance. One or two strong features: a shape, a colour, an item.
  5. How they speak. Short sentences? Formal? Jokes under pressure?

A common check among character artists is the silhouette test. Fill the character in solid black. If you can still tell who it is, the design is readable at small sizes and in motion, which is how players will see it.

Keeping characters consistent with AI art

AI image tools make striking character art, but they tend to change the character between images. A few habits help:

  • Write a character sheet. A fixed description of face, hair, clothing, colours and proportions, reused word for word.
  • Use reference images. Several image tools accept references. Google's image model, for instance, supports "character consistency for up to 4 characters" from reference images.
  • Ask for transparent backgrounds when you need sprites. ChatGPT's image tool can "make the background transparent."
  • Pick a simple style. Flat colours and bold shapes stay consistent far more easily than detailed realism.

Not every AI assistant makes pictures. Anthropic's help pages say Claude "doesn't generate photos or illustrations the way image-generation tools do," though it is strong at writing game code. Our comparison of Gemini, Claude and ChatGPT for game building covers which model does what.

Prompt
Help me develop the main character for my game.

Game pitch: [one line]
Setting: [one sentence]
Role in the game: [what the player does as this character]

Give me:
1. Name, age and one-sentence background.
2. What they want, and what stands in their way.
3. One flaw and one endearing habit.
4. A visual description built around two features that would be recognisable as a silhouette.
5. Five sample lines of dialogue that show how they speak.
6. A character sheet: a fixed paragraph describing their appearance that I can paste into an image tool every time to keep them consistent.

Step 6: Brand the game

Branding is how your game is recognised before anyone plays it: the name, the logo, the main image and the one-line description. On a store page or in a social feed you have about a second. With thousands of games released every year, a clear identity is what gets a game noticed.

The name. Short, easy to say, easy to spell, and not already used by another game. Search the stores before you commit. A name that hints at the mechanic or mood does more work than an invented word.

The key art. One image that represents the game everywhere: store page, project page, social posts. It should show the main character or central idea, read clearly at thumbnail size, and match how the game looks.

The logo. The title in a distinctive style. It must be legible when small.

The palette. Three or four colours used across the game, the art and the page.

The pitch line. One sentence saying what the player does and why it is different.

A short clip. Ten to twenty seconds of real gameplay. For a game, footage persuades better than any description.

Keep one rule above the rest: the branding must match the game. Painted key art on a game made of flat shapes disappoints people at the worst moment, straight after they click.

Be open about how the game was made. Steam's content survey asks developers to disclose AI-generated content. Kickstarter's rules ask creators to state whether they use generative AI on their page or in their project. Players vary in how they feel about AI art, so tell them up front.

Prompt
Help me brand my game.

Pitch: [one line]
Type: [game type]
Tone: [two or three words]
Art style in the game: [description]

Give me:
1. Ten name ideas, each short and easy to spell, with a note on what it suggests.
2. A one-sentence pitch line under 20 words.
3. A palette of four colours with hex codes and what each is used for.
4. A description of the key art: what is in the image, the composition, and why it reads at thumbnail size.
5. A logo direction: lettering style and one visual idea.
6. A 15-second gameplay clip outline, shot by shot.

Step 7: Build it with AI tools

With a one-page design in hand, you are ready to build. You need three things.

A coding tool

This is the program you talk to, which writes and runs the code. The usual name for it is a harness. The main ones are Cursor, Claude Code, Codex and Replit Agent. Beginners often start with a browser-based tool such as Replit, where there is nothing to install. See Cursor vs Claude Code for game building for a full comparison.

We also have a step-by-step tutorial for each of the most common starting points: build a game with Replit, build a game with ChatGPT and build a game with Claude.

An AI model

The model is the AI doing the thinking inside the tool. The leading ones come from Anthropic (Claude), OpenAI (GPT) and Google (Gemini). They differ in price and in how well they handle game code. Our guides to the best models for game building and the cheapest LLM API go into detail.

An engine or framework

This is what the game runs on. For a first AI-built game, the web browser is a good target: nothing to install, and you can share it with a link. Many AI-built games use Three.js for 3D. Our Three.js game tutorial builds one from scratch. For engines such as Godot, Unity and Unreal, see how to make an indie game.

How to work with the AI

The tool makers publish their own advice, and it agrees on the essentials.

  • Start from a written spec. Anthropic's guide suggests having the AI interview you and write the spec to a file, then starting a fresh session "so the build begins with a clean context and a written definition of done."
  • Build in small steps. Ask for the core loop first. Add one feature at a time and play after each.
  • Tell it how to check its work. The same guide says to "give Claude something it can run that comes back pass or fail."
  • Keep a rules file. A short file of project rules, often called AGENTS.md, is read by the AI at the start of each session.
  • Save your progress. Use the tool's checkpoints or version control so you can undo a bad change.

When something breaks, describe what you saw, not what you think the cause is. "When I press jump twice quickly, the player falls through the floor" gives the AI what it needs.

Prompt
Read SPEC.md. Build only the core loop described there, using placeholder shapes and no final art.

Rules:
- Work in small steps and run the game after each one.
- Do not add features that are not in the spec. Ask me first.
- Use fixed numbers from the spec for speed, health and timing, and put them in one config file so I can tune them.
- When the loop works, stop and tell me how to run it, what to try, and what you would build next.

Art, sound and music

For visuals, begin with free asset libraries or simple shapes, then replace them once the game is fun. For AI-made art, see the consistency tips in step 5. For sound, free libraries cover most needs, and AI music tools exist: Google's Lyria models, for example, generate music from text prompts. Check the licence terms of any tool or library before you sell a game that uses its output.

Step 8: Test, share and find support

Test with real people early. As soon as the loop works, watch someone play without helping them. Where they get stuck is your to-do list.

Share a playable link. A browser game can go on itch.io for free. A link people can click will reach far more players than a download.

Give the project a public page. Somewhere with the pitch, the art, progress updates and a way to follow. One X user summed up the gap neatly: "You vibe coded it. Now share it." Our guide to starting a project covers how.

Think about money once people care. If the game needs funding to finish, there are several routes: your own time, crowdfunding, grants, indie funds or a publisher. Almost all of them ask for a playable build and some evidence of an audience. See how to make an indie game and fund it and our guide to Kickstarter alternatives.

Mistakes to avoid

  • Starting with the biggest idea. Make the small game first.
  • Asking the AI for "a game" in one message. Break it into the loop, then features, one at a time.
  • Writing lore before the loop works. Story will not rescue dull gameplay.
  • Mixing art styles. One simple style throughout looks intended.
  • Not playing your own game. Play after every change. The AI cannot feel what you feel.
  • Building in private for months. Share early and let reactions steer you.

Your first week

  • Day 1: Pick a game type and write the one-line pitch.
  • Day 2: Fill in a one-page design document. Decide what is out of scope.
  • Day 3: Create concept art and a project page. Share it with five people.
  • Days 4 and 5: Build the core loop with an AI coding tool. Play it. Adjust.
  • Day 6: Add a start screen, a win or lose state and a restart.
  • Day 7: Put it online and send the link to someone who has not seen it.

By the end of the week you will have a small game that plays and a page to show for it, and you will know what to build next.