Make Games with AI lessons
Make a game by describing it
A playable mini platformer beside the prompt that made it.
In this course you make games by describing them to an AI coding agent. The agent writes the code, and you play, judge and ask for changes.
The little level above came from one short prompt. A real game takes many rounds of prompt, play and tweak.
You need an agent on your computer, which Make Websites with AI shows you how to set up. Clear prompts matter a lot here, so AI Prompt Engineering helps too.
Pick a route
A game library is code you add to a normal project, like Phaser for 2D or three.js for 3D. These games run in a web browser and live in plain text files.
A game engine such as Godot, Unity or Unreal is a full app with an editor, physics and export tools. Engines suit bigger games but take longer to learn.
Five routes compared: language, platforms, what each suits, and how well an agent works with it.
Agents work best when the game lives in text files they can read and edit. Keep that in mind when you choose.
Practice: Pick the route
Choose the best library or engine for each game idea.
Let the agent set it up
You don't need to create the project by hand. Ask the agent to scaffold it: make the folders, install the library and start a test server.
Say which library you want and what the first screen should show. Then open the link it gives you and play.
An agent scaffolds a Phaser project from one prompt, then the files it made.
Look at the files before asking for more. Knowing where the level and the player live makes your next prompts sharper.
Practice: Find your way around
Match project files in Phaser, Godot and Unity projects to what they do.
The game loop
Every game runs a game loop. Many times a second it reads the input, updates the world and draws the new picture.
Each pass through the loop is one frame. Most games aim for 60 frames per second.
The input, update and draw steps of one frame, slowed down, moving a ball.
When you ask for a change, think about which step it touches. A new key is input, a new rule is update and a new sprite is draw.
Delta time
Frames don't all take the same time. A slow computer might manage 30 frames a second while a fast one manages 120.
So games move things by speed times the time since the last frame. That time is called delta time, written \Delta t.
Moving with delta time: \text{new }x = x + v \times \Delta t
Two runners at a chosen frame rate: one moves a fixed step per frame, one uses delta time.
If something speeds up or slows down when the frame rate changes, ask the agent to use delta time for it.
Practice: Move by delta time
Work out a new position from position, velocity and delta time.
Describe the mechanics
A mechanic is a rule the player interacts with, like jumping or collecting coins. Vague prompts get generic games, so describe each mechanic exactly.
Cover four things: the controls, the rules, how you win or lose, and the feel. Feel is how playing should seem, like snappy or floaty.
A vague prompt beside a precise one, part by part.
Practice: Sort the spec
Sort spec lines into controls, rules, win or lose, and feel.
Tune by playtesting
The first version rarely feels right. Playtesting means playing, noticing what feels off and changing one number at a time.
A jump depends on two numbers: the jump speed v and the gravity g. It peaks at a height of h = \frac{v^2}{2g}.
Sliders for jump speed and gravity, with the jump plotted against time.
Ask the agent to put these numbers at the top of a file, or on sliders in the game. Then you can tune them without a new prompt each time.
Practice: Tune the jump
Set jump speed and gravity so the jump clears a ledge and lands in time.
Art and sound from AI
Games need assets: sprites, backgrounds, sound effects and music. Image, sound and music AI tools can make them from a description.
A sprite sheet packs every frame of an animation into one image. Ask for frames of one size, in one style, on a see-through background.
A four-frame walk cycle sheet, with the frame the game shows highlighted.
Free asset packs are another fast option. Either way, tell the agent the file names and frame sizes so it can wire them up.
Check the licence
Every asset has a licence that says how you may use it. CC0 means free for anything, and CC BY means free if you credit the creator.
Licences marked NC ban commercial use, so keep them out of games you sell. For AI tools, read their terms, and keep a credits file of where every asset came from.
Sort assets by what their licence allows in a game you will sell.
3D with Blender MCP
Blender is free 3D software for making models, materials and scenes. Blender MCP connects your AI agent to Blender while it is open.
A small add-on inside Blender receives the agent's requests. The agent can read the scene, then run Blender's Python commands to add objects, set materials and arrange them.
An agent builds a low-poly chest in Blender through Blender MCP.
Describe the size, style and colours, just as you would for a sprite. Then look at the viewport and ask for fixes.
From Blender to your game
Export models as glTF, a standard 3D format saved as a .glb file. three.js and Godot load it directly, and Unity loads it through a package.
Check the size before you export. One Blender unit is one metre, and the engines read it as a metre too.
Order the steps from Blender MCP to a model in the game.
Give the agent the engine
In an engine, much of the game lives in the editor, not just in text files. An MCP server for the engine lets the agent work inside that editor.
Unity has an official MCP server, still in beta, and community servers exist for Unity and Godot. Through them an agent can create objects, edit scripts, run the game and read the console.
You, the agent, an MCP server and the editor, with results flowing back.
Godot keeps scenes and scripts as text, so an agent can also edit a Godot project directly. Either way, letting the agent read errors itself saves a lot of copying.
Practice: Read the error
When something breaks, the console shows an error with the file and line where it happened. Send the agent the whole error, not just "it's broken".
Read console errors from a browser game and Unity, and decide what they mean.
One feature at a time
Big requests produce big, tangled changes. Ask for one feature at a time, and play the game after each one.
When a feature works, save a checkpoint with a git commit. If the next change breaks things, you can go straight back.
A terminal: commit a working feature, then restore after a broken change.
Many agents can undo their own edits too. Git works with every tool, though, and keeps your whole history.
Practice: Save a checkpoint
Type the git commit command with the given message.
Write a design doc
A design doc is a short file that describes your game: the idea, the controls, the rules and what is done. The agent reads it, so it doesn't forget your decisions.
Many agents read a file like AGENTS.md or CLAUDE.md at the start of every session. Point that file at your design doc, and update the doc as the game grows.
Fill the gaps in a design doc with precise lines, leaving out the vague ones.
Publish your game
A web build turns your game into files any browser can run. Ask the agent to make one, or use the Web export in Godot or Unity.
itch.io is a free site for sharing indie games. Zip the build with index.html at the top level, upload it, and mark it as playable in the browser.
From a web build to a shareable itch.io link in four steps.
Then share the link and watch people play. Where they get stuck shows you what to fix next.
Where next
Try a game jam: a challenge to make a game on a theme in a few days. itch.io lists many, and a short deadline keeps your game small.
Keep reading the code your agent writes. The more you understand, the better your prompts become.
Match common problems from the course to the first thing to try.