AgentGames

Search titles, descriptions, models and tags. Press Enter to see results.

💬 Guide

How to make a game with ChatGPT

No terminal, no engine, no account beyond the one you already have. Five steps, one prompt to copy, and the one place everybody gets stuck.

Updated 23 September 2026 5 min read By the Agent Games team
Jump to a section
  1. Five steps to your first game
  2. Saving the file is where people get stuck
  3. Then fix one thing at a time
  4. Which ChatGPT model should you pick?
  5. What a finished game really takes
  6. Common questions
  7. Where to go next

Ask ChatGPT for the whole game in one message. Save what it writes into a file called game.html, then open that file. Play it, name the single thing that feels wrong, and send that. Ten minutes gets you something playable.

What you need

A ChatGPT account, free or paid. A web browser. Ten minutes. You do not need a code editor, a game engine, or any programming.

Five steps to your first game#

Start a new chat

Open a fresh chat so nothing earlier confuses it. If your plan lets you choose a model, take the strongest one it offers. There is a section below on which that is.

Paste the prompt below and send it

One message, nothing else. ChatGPT answers with a single long block of code. That block is the entire game.

Save the code as game.html

Copy the block, paste it into a plain text editor, and save it under that exact name. This is the step people trip on, so it has its own section next.

Open the file and play for a minute

Double click it. Play it properly and lose on purpose. Most faults only show themselves at the moment you die or start again.

Name one thing that is wrong

One, never ten. The score does not reset when I press play again. ChatGPT sends back a corrected file, you play again, and you name the next one.

PromptCopy this, paste it, send it
Write a complete browser game as ONE .html file I can double click.
Everything lives in that one file. No frameworks, no downloads, no images.

THE GAME: a cat runs across rooftops. Tap or press space to jump the gap
between two buildings. The gaps get wider as the score climbs.

LOSING: fall in a gap and the run ends. Show the score, the best ever
score, and a button to run again.

CONTROLS: the space bar, and a tap anywhere on a phone screen.

LOOK: draw everything with canvas shapes and flat colour. No pictures.

MEMORY: keep the best score in localStorage.

THREE RULES THAT MATTER:
1. Move everything by elapsed seconds from requestAnimationFrame,
   capped at 0.05, so a fast screen does not run the game at double speed.
2. Include the CSS rule canvas { touch-action: none; } or a tap on a
   phone scrolls the page instead of jumping.
3. Gather every number I might want to change into one CONFIG object
   at the top of the script.

Give me the finished file in one code block, ready to copy.

Rewrite the two lines under THE GAME and LOSING for your own idea and leave everything else alone. Those last three rules are the difference between a game that works on a phone and one that only works on the laptop you wrote it on.

That is the whole method. Everything below is detail on the steps you have already read.

Saving the file is where people get stuck#

A browser cannot play code that is sitting in a chat window. It needs a file on your computer, and the name of that file has to end in .html. Nothing else about this step is hard.

From the chat window to a file you can play ChatGPT writes the game into the chat. Getting it out of the chat is three moves. 1 Copy the code Use the copy button at thetop of the code block. Takeall of it, first line to last. 2 Paste it in a text editor Notepad on Windows.TextEdit on a Mac, switchedto plain text first. 3 Save it as game.html Then double click it. It opensin your browser, and thatis your game. The trap: Notepad saves game.html.txt unless you set Save as type to All Files. On a Mac, TextEdit needs Format then Make Plain Text first. Otherwise you get code on a page, not a game.
The file has to land on disk with the right name. Everything after that is playing and fixing.
  • On Windows. Open Notepad, paste, then File and Save as. Change Save as type to All Files, then type the name yourself. Left on Text Documents you get game.html.txt, which opens as a wall of code.
  • On a Mac. Open TextEdit, choose Format then Make Plain Text, paste, and save it as game.html. Answer Use .html when it asks about the ending.
  • Either way. Double click the saved file. A game means you got it right. Code on a white page means the name is still wrong.

Paid ChatGPT plans also include Codex, which is the OpenAI agent that runs on your own machine. It writes and saves the file itself, so none of this applies to it. The chat window is enough to finish a game, so there is no need to install anything today.

Then fix one thing at a time#

First versions run. They almost never feel good. Every hour between those two states is the same short loop.

The loop that gets you a finished game Write the brief Seven fields, once. Generate One file, no build step. Play it for a minute Actually play. Do not skim. Name ONE thing that is wrong Screenshot it. Quote the error text. Say what you expected, and what happened instead. repeat 8 to 15 times What not to do “It is broken, rewrite the whole thing.” You lose every fix you already landed. Each pass changes one thing, so you always know what broke it.
One fault per message. Report two at once and you cannot tell which answer broke what.
  • Paste errors instead of describing them. Press F12 in the browser, open the Console tab, and copy the red text into the chat. That usually ends the problem in one reply.
  • Screenshot anything you can see. Press Win + Shift + S, or Cmd + Ctrl + Shift + 4 on a Mac, then Ctrl + V into the message box. A screenshot pastes exactly like text.
  • Ask for the complete file every time. Splicing a fragment into the middle of a working file by hand is how beginners lose a working game. Say: send the whole file again.
  • Keep the version that worked. Before a big change, save a copy as game-02.html. A bad answer then costs you one file instead of an evening.

The faults that turn up in nearly every first build, each with a ready prompt to fix it, are collected in the prompt guide.

Which ChatGPT model should you pick?#

Build with the strongest model your plan offers, then drop to a cheaper one for small edits once the game works. The list in the picker changes as OpenAI ships models, so go by what each one is for rather than by the name.

ModelWhat it is forAPI price per million tokens
GPT-6 AstraBuilding the game, and bugs that survive two tries.$10 in, $50 out
GPT-6 SolCoding and agent work at a much lower price.$2 in, $10 out
GPT-6 LunaQuick edits, and what free accounts are given.$0.10 in, $0.50 out

OpenAI list prices for the API, read from the pricing docs on 23 September 2026. Inside a ChatGPT plan none of this is metered, so read the column as a comparison rather than as a bill.

What a finished game really takes#

Ten minutes buys you something playable. A game other people play to the end is a different job, and every creator on Agent Games reports what theirs took.

ModelGames hereAverage tokensAverage build time
GPT-6 Astra57.9 million4 hours
Claude Fable 5.1910.4 million13 hours 52 minutes
Claude Opus 5144.2 million8 hours 36 minutes

Every published game here with a reported token count, on 23 September 2026. The five GPT-6 Astra games arrived between 14 and 18 September and have been played 469 times.

Read that table carefully

Nobody here has built the same game twice with two models, and the figures come from the creators themselves. The table records what people reached for and what it took them. It does not say which model is better.

💬Games on this site written by GPT models

View all ›

Common questions#

Can ChatGPT actually make a game?

Yes. It writes a complete browser game as a single HTML file, which you save and open. A simple arcade game often works on the first try. Levels, saved progress and anything with other players take many rounds of fixes.

Can I make a game with ChatGPT for free?

Yes. A free account can write a single file game. Free plans get the cheaper model and a message limit, so a long fixing session may stop for a few hours. The method itself does not change.

Where do I put the code ChatGPT gives me?

Into a plain text file named game.html, saved anywhere, then opened in a browser. On Windows use Notepad with Save as type set to All Files. On a Mac use TextEdit switched to plain text first.

Which ChatGPT model is best for making games?

The strongest one your plan offers, which is GPT-6 Astra on paid plans today. GPT-6 Sol handles small changes for a fraction of the price, and GPT-6 Luna is what free accounts are given. All three can write a simple arcade game.

How long does it take to make a game with ChatGPT?

About ten minutes to something playable. The five GPT-6 Astra games published here averaged roughly four hours of build time and 7.9 million tokens each. Finishing is the long part, not starting.

Can I publish or sell a game ChatGPT wrote?

It stays yours. Publishing it here does not change that, and anyone can play it without an account. The one rule is that you cannot name it after a game somebody else owns.

Where to go next#

When the game is worth someone else's time, publish it. It gets a page of its own listing the model, the prompt and the tokens behind it, and people can play it without signing up for anything.

For ten more prompts you can send unchanged, and a repair prompt for every common fault, read the prompt guide. If you also have a Claude account, the Claude version of this guide covers the same ground with an agent that writes the file for you. The made with pages list every game here by the model that wrote it.