Prompts that come back with a playable game

You paste a prompt into an agent, and ten minutes later the build runs, the score never changes, and nothing looks broken. The prompt described how the jump should feel instead of what the score does. The fix is four lines: the loop, the rule, the end, and one line about the look. Below are those four lines, four starter prompts you can paste now, and the four prompts that come back wrong, each with the fix.

Three panels: the same platformer before a prompt, the prompt itself, and the level after the change

The game definition is the prompt

The four lines below are the whole game definition, and they are the part people leave out. Give these and the agent has something to build; leave one out and you get a demo that looks right and plays wrong. A text to game AI platform will hand you the same four lines in a different order if you give it the same four decisions.

When someone says a prompt did not work, they usually mean the request was missing a decision rather than the model being weak. The agent does not know what the player is supposed to do, so it invents something. Because it invents the same thing every time, the result is consistent and presentable, and wrong. Writing the game down first is the fix, and it is smaller than it sounds: four lines, one of them optional. In AI for game development the variable that decides the result is usually the brief, not the model: for an Unreal Engine 5 project it is whether the agent can read your files before it changes them.

The loop

What the player repeats, in one sentence: move, collect, dodge and the like. This is the verb the player performs over and over, and it decides what the code has to support. A prompt that only describes a world, such as a city or a spaceship, has not described a game yet, because nothing in it tells the player what to do between frames.

The rule

What decides the outcome, written down so it can be implemented: what scores, and what counts as a win. This is the part that has to be precise, and the part that has to survive as code. If the rule is written in adjectives it cannot be implemented and cannot be tested; if it is written as numbers and conditions, it can be a function with a test next to it. Teams doing AI in video games often write this line first.

The end

The condition that stops the round: a time limit, a number of lives, a wall that ends the run. Without it the agent usually builds an endless sandbox, which tells you nothing about whether the mechanic works. An end condition is also the cheapest way to make a prototype testable, because it gives you a repeatable run with a result, and an H5 game generator needs one before it can give you a result worth reading.

The look

One line of direction: flat colours, pixel art, realistic, no art at all yet. This one is optional and it is the one people spend the most words on. Its job is to stop the agent inventing a style you will have to throw away later, not to describe a world. “No art yet, coloured rectangles” is a complete answer.

A prompt with these four lines is usually two or three sentences long. Length is not what makes a prompt good. Writing the rule down is. A long prompt that describes a feeling produces a demo; a short one that states a rule produces something you can build on.

Once the four lines exist, the next step is to hand them to an agent in a way that leaves you a trail you can check. The starter prompts below are written that way, and they work the same whether you paste them into a coding agent or into a text to game AI platform.

Four starter prompts you can paste now

These are the prompts behind the four browser starters we ship. Each one is complete: copy it, paste it into an agent that has your repository open, and you get a running build with a test next to it. Between them they cover the four things people ask an agent for: a first playable loop, a rule worth arguing about, a mechanic in an existing project, and a number to tune. Every one of them ends in an H5 game you can open in a browser.

Starter 01 · the smallest loop

Grid runner with one rule and one loss condition

A square grid, one key to move, one obstacle, and a run that ends when you hit it. The agent writes the grid, the movement, the collision, and a test that fails when the loss condition is wrong. It is the smallest thing that is still a game: one loop, one rule, one end, and a check that says the end works. Start here if you have never done this before, because the diff is small enough to read in full.

Build a playable browser game prototype in this repository:

- A 10x10 grid the player moves with the arrow keys.
- One wall cell that ends the run when the player enters it.
- A test that fails if the player can enter a wall cell and the run continues.
- One command that starts the game locally.

Keep the rule in one file and the test next to it. Tell me which files you will change before you change them.
Starter 02 · the contested rule

Scoring rule with the edge cases written down first

The rule as a pure function, plus the three edge cases that usually get argued about. You get back a test suite, and the test suite is the part that survives the next feature. The order matters: the tests are written before the implementation, so the agent cannot quietly define the rule as whatever the code happens to do. This is the prompt that turns a text to game AI platform into a project you keep working in, instead of an H5 game generator demo. The tool this page is about takes a description in and hands back a browser build, with a diff only if the source comes with it.

In this repository, implement a scoring rule as a pure function with no side effects:

- +10 per collected token, +50 for a full row, -1 per second elapsed.
- Write the tests first: empty board, full row, and a timeout at the boundary.
- Run the tests before you write the implementation.
- Do not change any rendering code.
Starter 03 · inside an existing project

One mechanic ported into an existing codebase

For a project that already has movement and collision, the prompt asks the agent to read first and propose the smallest change, so the mechanic arrives in the shape the codebase already expects. It also asks for a regression test for the existing jump, and that is the test which tells you the new state did not break the old one.

Read this repository first and report where movement, collision, and the input handling live.
Do not change anything yet. Then propose the smallest change that adds:
- a double-jump that only works while a dash timer is running.
- one test for the new state and one regression test for the existing jump.
Explain each step before you write it.
Starter 04 · the tunable number

A number you can tune instead of a system you rebuild

One tunable parameter and a way to change it at runtime. This is the fastest loop for finding the feel you want without losing the tests, and it is the one people skip: a gravity number buried in the middle of a file is a number you will edit forty times, and every edit is a chance to break something. In Unreal Engine 5 the same value belongs in a config object, and the prompt that extracts it is the same prompt.

In this repository, extract the game feel constants into one config object with named values for gravity, jump height, and scroll speed.
- Keep the values identical to the current ones.
- Add a test that asserts the current gravity value, so the change is visible.
- Print the config on start so I can see what I am changing.

Read the last lines of each prompt before you run it. They repeat on purpose — keep the rule in one file, keep the test next to it, and say which files you are going to change before you change them — and they are the reason the output is something you can keep working in. An H5 game generator gives you the folder; these prompts turn it into a repository.

Two of the four prompts end with a request for a check — the test suite in Starter 02, the config object in Starter 04 — and both words mean something slightly different in every codebase. Replace the generic word with the command your project actually runs. The next section is the list.

Both of those words are placeholders, and a placeholder is a decision you have not made. In AI in video games the same placeholder arrives with every new hire and every agent run, and it is cheaper to replace it once in the prompt than in every project.

Swap the check command for your stack

Every starter prompt ends with a request for a check: a test runner, a script, a config object. Those three words mean different things in different codebases, and naming the abstract idea instead of the concrete command gets you a test file in a framework you do not use.

So before you paste a prompt, replace the generic word with the one your project already uses. The list below covers the stacks most first games are written in. Name the command your project runs today, and tell the agent to run that one.

What to name, per stack
Your project isName the check asThe config object isSay this in the prompt
A JavaScript or TypeScript repositoryYour own test script, the one declared in package.jsonAn exported object with named keys“Run npm test before you write the implementation, and do not add a dependency.”
A Python repositoryYour existing runner plus the module pathA dataclass or a dict of named values“Run the project’s own test command on the module, and do not install a new test library.”
A compiled C++ or C# codebaseThe Unreal Engine 5 build target first, then the test binaryA struct in a header, with the values as named fields“Build the project, then run the test target, and report both results.”
An editor-driven projectThe editor’s own command or test entryUsually a data asset rather than a code file“Run the project’s own check entry and paste the output before you continue.”

Two details survive every stack. The check has to be one the project can already run, and the agent has to be told not to introduce a second one: “do not add a new dependency” is five words that prevent the most common wrong turn. And the config object has to keep the current values identical, because the point of extracting it is to change one number later.

The table covers the stacks most first games are written in, and the fourth row catches people in Unreal Engine 5 projects: the editor has its own check entry, and asking for “a test” there gets you a test in the wrong place. The prompts that drive the editor rather than the repository are the ones here: a procedural graph, an asset step or a build target.

If your project has no check at all, that is the first thing to add, before you let an agent change anything in it. A project without a check cannot tell you whether the agent broke it, so every change becomes a manual play-through.

When the project already exists

When the code is already there, two lines change: ask for the map before the change, and ask for the rule to be pulled out of the drawing. The other two lines stay exactly as they are. In AI for game development that is the difference between editing a title and replacing it.

This is the case that catches people out, because the four lines are unchanged and the behaviour is not. A prompt that works in an empty repository produces a new codebase next to the old one in a repository that already has one, and then you have two movement systems and no way to tell which one the input handler calls. The first two lines of the prompt are where the fix lives, and that is the difference between a prototype and a patch.

Variant · existing project

Make the rule testable without changing the game

For a prototype that already plays but whose rules live inside the drawing code. The prompt asks for the map first, then for the smallest split that makes the rule testable, with the current behaviour pinned down before anything moves. Use it when the game works and you want to keep it working while you make it maintainable; it is the one AI in video games teams reach for when a live title has to survive its next release. The same four jobs come back one step down in size.

Read this project first and report where the gameplay rule lives and where it is called from.
Do not change anything yet.

Then make the smallest change that:
- moves the rule into one pure function with no drawing calls in it,
- keeps the current behaviour exactly as it is,
- adds one test that pins the current behaviour down before the split.

Show me the plan before you write it.

One line in that variant is worth copying: “Do not change anything yet” turns the first response into a map you can correct before any code is written. The second line, “keeps the current behaviour exactly as it is”, gives the agent something concrete to preserve instead of something to improve.

The check you ask for has to be one your project can already run, and that differs per stack. Name the tool you trust — the test runner, the script, the scenario — instead of asking for “a test” in the abstract, because “a test” is the word most likely to get you a test file in a framework your project does not use. The stack list above gives the wording for each one, and an Unreal Engine 5 project has its own answer in the editor command you already run.

Four prompts that come back wrong

Each of these looks reasonable and produces a demo that does not play. In every case the fix is the same kind: name the decision instead of the feeling.

Bad prompt, the sentence that fails, and the rewrite that works
The prompt that comes back wrongThe sentence that failsThe rewrite that works
“Make a fun platformer”“Fun” is the only decision in the sentence, and it is one only you can make. There is no rule to implement, so the agent invents one and you get a scrolling rectangle.“The player jumps with one key. One obstacle ends the run. The run lasts thirty seconds. Then write the collision check for that obstacle.”
“Add double jump like the other games”“The other games” is not in the repository. The agent will either ask what you mean, or quietly copy whatever it finds, and in a project with two similar features that is the wrong one.“Add a double jump that is allowed only while the dash timer is running, and that must not change the existing jump. Read the existing jump first and show me the file.”
“Make it feel better”“Feel” is not a spec, and it is the request most likely to produce a diff nobody can review. No number is named, so nothing can be measured before or after.“Put gravity into one named value, keep its current number, and assert that number in a test so the change shows up in the diff.”
“Just build the whole game”Too big for one request. The context drops halfway through, which is why the result is a menu, a scoreboard and no playable loop.“Build one mechanic: the grid, the movement and the collision. Then stop and show me the test that proves the loss condition works.”

Swap the judgement for a decision

“fun”→a rule: one obstacle ends the run
“like the other games”→a boundary: only while the dash timer runs
“feel better”→a number: gravity in one named value
“the whole game”→a scope: one mechanic, then stop
Every rewrite in the table above is this one swap: name the decision instead of the judgement.

The common thread is that each of these asks for an outcome the agent cannot measure. Fun, like the other games, feel, the whole game: all four are judgements only you can make, and an agent that has to guess one produces something plausible and wrong. Rewrite the request as a decision — a rule, a number, a boundary — and it becomes something an agent can satisfy and you can check. In AI in video games that swap is where the saved time is.

Read the middle column before you rewrite. It tells you which part of your own prompt is the problem, and in practice it is almost never the sentence you were worried about.

None of these four is a model problem, and that is worth saying before you blame the tool. In AI in video games the same four sentences arrive from teams that have a working build and a prompt describing a feeling. The rewrite takes one line, and the line is usually the same from project to project.

When the first attempt misses: fix the prompt, not the model

The cheapest move after a bad result is two extra sentences in the next prompt. They turn a rewrite into a correction.

When a prompt comes back wrong, the brief was usually vague rather than the model being weak. You can find out which in one turn, before paying for a rewrite: ask the agent to restate the mechanic in one sentence and to list the files it plans to touch, before it writes any code. That turn is the most useful habit in AI for game development.

If the restatement is wrong

The prompt was wrong, and you have found that out before any code was written. Rewrite the rule in the agent’s own words. Usually something was missing, most often the end condition or the number, and send it again. This is the cheapest failure mode in the whole workflow, because it costs one turn and no code. Teams doing AI in video games count that turn as the cheapest line in the budget.

If the restatement is right

The brief was fine and the implementation was wrong, which is a check problem rather than a prompt problem. Ask for the test that would have caught it, and keep that test: it is usually more valuable than the code it replaced, because the next change will need it too.

One turn tells you which failure you have

Ask the agent to restate the mechanic in one sentence — before it writes any code

The restatement is wrong

The prompt was wrong. Rewrite the rule in the agent’s own words — usually the end condition or the number was missing — and send it again. One turn, no code, nothing to undo.

The restatement is right

The brief was fine and the code was wrong. Ask for the test that would have caught it, and keep that test: it is usually worth more than the code it replaced.

One extra sentence in the next prompt tells you whether you need a new prompt or a new test.

Both cases get cheaper with two habits. Keep the prompts themselves in your own notes, because the prompt is the part that transfers between tools and the part nobody remembers. And ask for one mechanic per turn, so a miss costs you a small diff rather than a folder of files you have to sort out afterwards. In AI in video games those notes are the only artefact that survives a change of tool.

These prompts are free to copy and are not tied to any tool: they work in any coding agent that can read a repository, and in a text to game AI platform where the output is an H5 game you can host anywhere. What costs money is the agent run, not the prompt text — the cost section of the how-to guide breaks down what is free, what a paid run buys, and how to estimate the runs a one-off prototype needs. In AI for game development the prompts are the part you can take with you.

Frequently Asked Questions

Turn Your Game Prompt into a Playable Idea

Use AI game builder prompts to start and refine a game with MiniMax Code.