What prompts make a good browser game with AI?
Quick answer
The difference between a prompt that produces a publishable game and one that produces a broken mess is rarely the game idea. It is the missing instructions about format and constraints. An assistant cannot guess that you want one file with no network access — so you have to say it.
Why does the prompt matter so much?
An AI assistant will happily build a game that assumes a folder of image files, a bundler, and a server it can call. That game runs fine in a loose preview and then fails the moment you try to share it. The prompt is where you rule those assumptions out. Spend the words up front and you skip a round of confusing debugging later.
What should every game prompt include?
- The format: "a single self-contained HTML file, all code inline"
- One mechanic, described in a sentence or two
- The controls: arrow keys, mouse, one button, or touch
- A win or lose condition, so the game has an ending
- The constraints: no external files, no network calls, resizes to the window
What should you leave out?
Leave out everything that is not the core mechanic. Menus, level select, settings screens, saved high scores, and sound can all come later. If you list them in the first prompt, the assistant spreads its effort thin and the core game ends up half-built. Say so directly: "no menus, no levels — just the core game on one screen."
An example prompt that works
This prompt names the format, describes one mechanic, gives it an ending, and rules out the things that break a publishable game:
Make a single-file HTML game. Put all HTML, CSS, and
JavaScript in one file with nothing external.
The game: the player moves a ship left and right with the arrow keys
to dodge rocks falling from the top. The score goes up the longer they
survive. One hit ends the game with a restart prompt.
Requirements:
- Use the canvas API and draw everything with shapes (no image files).
- Make the canvas fill the window and resize with it.
- Do not use fetch, network requests, or external assets.
- Keep the whole file under 500KB.Copy-and-customize prompt templates for specific libraries are collected on the ArcadeLab prompts page.
How do you iterate after the first version?
Treat the first reply as a draft. Run it, then change one thing at a time: "the ship moves too slowly," "rocks should fall faster as the score climbs," "add a flash when the player gets hit." Small, specific follow-ups keep the working game working. Large rewrites tend to reintroduce bugs you already fixed. When it plays well, see the common bugs to check before publishing.
Got a game you like? Publish it at arcadelab.ai/publish.
Ready to publish? Paste your HTML file and get a URL.
🚀Publish your thing