How to make a game with AI
There are two ways to make a game with AI. A chatbot like ChatGPT, Claude or Gemini writes code that you save, run and fix yourself. A game app like Roam returns the game itself, playable, and you change it by asking.
Path 1: a chatbot writes the code
This route works on a computer and teaches you a lot. Expect to fix things.
- Ask for one file. Ask for a complete game in a single HTML file with JavaScript, no outside libraries. One file is easy to save and open.
- Save and run it. Paste the code into a text editor, save it as game.html and open it on your computer.
- Paste errors back. When something breaks, copy the error and describe what you saw. Ask for the whole fixed file, not a snippet.
- Add one feature at a time. Score, then enemies, then sound. Big requests tend to break working parts.
- Host it to share. To let friends play, you upload the file to a host such as itch.io. That part is on you.
Path 2: an app returns a playable game
Here the AI output is a game, not code. You never see a file.
Roblox Build, announced in July 2026, is a prompt-to-game tab in the Roblox mobile app. Its public alpha began in New Zealand, needs an age check (accounts 9+) and has a daily AI allowance.
Roam is a free iPhone app. You type a sentence or use a photo. The game comes back with world, art, characters, sound and rules. Then you edit it in the same conversation and play it solo or with friends.
Prompts that work on either path
Good prompts name the genre, the goal, the losing condition and one twist.
- Horror. "Horror in a school at night, flashlight with a battery, find 5 keys, my friends are the other survivors."
- Arcade. "Endless runner on rooftops, jump and slide, coins speed you up, one hit and you are out."
- Party. "2v2 in a mall, shrinking zone, last team standing, we are the characters."
- Follow-ups. "Make the first level easier." "Add a boss after level 3." "Make it two-player." Short, specific changes beat long rewrites.
Create it with Roam
Skip the code step. Describe the game on your iPhone, play what comes back, and change it by talking.
Try: "horror in a school at night, flashlight with a battery, find 5 keys, my friends are the other survivors"Questions people ask
Can ChatGPT make a game?
It can write the code for a simple game, often as HTML and JavaScript. You still save it, run it, fix bugs and host it yourself.
Can I make a game with AI for free?
Yes. Chatbots have free tiers for small code games, and Roam is a free iPhone app that returns a playable game.
What is Roblox Build?
A prompt-to-game tab in the Roblox mobile app, announced in July 2026. It started as a public alpha in New Zealand with an age check and a daily AI limit.
Keep exploring
- How to make a game with Claude
- AI game maker app: a game from one sentence on your iPhone
- Is there an AI that makes games? Yes, with limits.
- How to use Roblox Build
More on Roam: All Roam games Games to play, by kind