Make a Game With ChatGPT: The One-File Method
The simplest way to make a game with ChatGPT is to ask for one single HTML file, save it and open it in your browser. You install nothing, and you can keep going in the same chat until the file gets too long to handle.
An HTML file is a web page, and a browser can open it without any help. A whole small game fits inside one. OpenAI's help article on canvas, as seen on 2 November 2026, says HTML and React code is shown in a sandbox so you can see the result, and that some previews need to load outside files first. If you have that preview, use it. If you do not, the saved file works just as well.
How does the one-file method work?
- Ask for the game as one file.
- Copy the answer into a plain text editor and save it as
soup-rush-1.html. - Double-click the file to play.
- Tell ChatGPT what is wrong in plain words. "The pot flashes red, but the score does not drop" helps far more than "fix it".
- Save each better version under a new number:
soup-rush-2.html, and so on.
Step 5 is the one people skip, and it is the one that saves the game.
Worked example: Soup Rush
Soup Rush is an invented game. Ingredients ride along a belt, and you sort them into three pots before they fall off. Here is how the first rounds of the chat might go.
Round 1. You ask for the belt and the three pots, using coloured circles. It runs on the first try.
Round 2. You ask for orders, where each pot wants certain ingredients and a wrong one spoils it. Spoiled pots turn grey. You like it, so you save version 2.
Round 3. You ask the belt to speed up every 30 seconds. Good. Version 3.
Round 6. You ask for a nicer score display, and the score looks great. Then you notice that the belt no longer speeds up. ChatGPT rewrote the whole file, and the speed-up got lost on the way. Nobody asked it to go, and the reply did not mention it.
This is the classic failure of working in chat. Because you kept version 5, you can open both, see the difference and paste the missing part back in.
When is one file not enough?
Move on when you see these signs:
- Answers get cut off, or ChatGPT writes "the rest stays the same".
- Each fix breaks something from an earlier round.
- You want real pictures and sound in separate files.
Then it is time for a tool that works on your files directly. Codex is the next step inside ChatGPT. Not sure which game is the right size? The mechanics pages show how small parts add up.
Paste this to your AI
Build my game as one single HTML file with everything inside it: no other files, no pictures, no outside downloads. I will save it and open it by double-clicking.
The game: [two sentences about your game].
Before any code, sketch the game in Mermaid: each thing that can be going on, with arrows for what leads where. Then talk me through one full round in words and tell me where it could get stuck. Wait for my OK, and build exactly that. If the game changes later, change the diagram first.
Whenever you send a new version, send the whole file, never "the rest stays the same". Above it, list what you changed and what you left alone. For each change, quote the sentence of mine that asked for it. If you removed or rewrote something I did not ask about, say so and say why.
You cannot play the file from here, so do not tell me it works. Give me the exact steps to try and what I should see at each one.
Or skip this and connect the MCP: your AI then finds all of this by itself.Connect the MCP
ChatGPT cannot play your game, but it can walk through a drawing, so the diagram is its best chance to catch a mistake before you do. Mermaid is text that becomes a picture at mermaid.live.
How to check it worked
- Turn off your Wi-Fi and open the file. It should still start. If it does not, it depends on something from outside.
- Compare with the last version. Open both and play each for a minute. Anything missing is your first job.
- Follow its steps exactly. Where you see something else, paste what you saw into the chat.
- Check the list against your request. A change with no sentence of yours behind it needs a reason.
- Trace the diagram with your finger. Every arrow should be something you can make happen in the game.