AI CAMP / GAME MECHANICS
FOR YOUFOUR WEEKS · ONE GAME

Build a game. Then make people want to play it again.

You'll build Snake with an AI tool that writes code when you describe what you want. Then you change the rules, watch your friends play, and let a computer player loose on it to find the gaps. On demo day your game is in the arcade.

WEEK 1

Build Snake

Build Snake with an AI coding tool. Ask for one piece at a time, run it, fix what's wrong.

WEEK 2

Change the rules

Change the rules, or make your own small game on the same code. Watch three people play it.

WEEK 3

Let a bot play it

A computer player learns your game by trying, thousands of times. See what it finds, and fix your rules.

WEEK 4

Open the arcade

Put it on the web. Run your table at the arcade.

01ONE CLICK IN

Everything for the month

This month in detailWhat to hand in, each week's sessions, and how points add up.

What you'll hand in

150 points on offer100 passes the month
Everyone builds · 90Your team takes on · 25You choose · 35

Everyone builds

What every pair makes because the month asks for it. we call this InteractiveWe call this: InteractiveWhat the program asks every team to build.Michael’s words
due W1 FRI10 pts

My Assistant Log

What you asked the assistant, what it gave you, and what you changed: at least ten entries.

a table, one row per request
due W1 FRI15 pts

Playable Snake

Snake, built with an AI assistant, that someone outside your pair can play.

a game folder and a 1-minute screen recording
due W2 TUE10 pts

My Game on One Page

Your game, written down: goal, actions, scoring, difficulty and feedback.

one page
due W2 THU15 pts

One Rule Changed, Played by Three People

One rule of your game changed on purpose, and notes from three people playing it.

before-and-after notes and the change in the log
due W3 THU15 pts

What the Bot Found

Your bot's score chart, the strangest thing it did, and the rule you changed because of it.

a one-page report with a chart and a replay
due W4 THU15 pts

Playable in a Browser

Your game, opening and playing in a web browser on a computer that isn't yours.

a link on the class game page
due W4 FRI10 pts

Arcade Table

Your table at the demo-day arcade: thirty seconds of how-to-play, one story, and the bot screen.

live, at demo day

Your team takes on

Pick these up as a pair. Held to a higher bar. we call this InterdependentWe call this: InterdependentWhat a team chooses to take on together, beyond the brief.Michael’s words
due W3 FRI10 pts

Playtest Swap

Play another pair's game, write them three useful notes, and act on at least one of theirs.

notes given and notes acted on
due W4 TUE15 pts

Two-Player Mode

A second player in your game, on the same keyboard or against your bot.

the game and a note on what changed

You choose

Your own question. Held to the highest bar, because you picked it. we call this IndependentWe call this: IndependentOn your own: your curiosity, your practice, your experiment.Michael’s words
due W4 WED15 pts

My Own Rule Experiment

A question about your game you answer with a test you design: with people, with the bot, or both.

a one-page write-up
due W4 THU10 pts

Information Interview With Someone Who Makes Games

Twenty minutes with someone who designs, codes, tests or sells games, and what you learned.

five questions and a half-page of notes
due W4 FRI10 pts

Weekly Build Diary

Five lines every Friday: what you built, what broke, what you learned, what's next.

four short entries

The four weeks in detail

01Build Snake with an assistantBuild Snake with an AI coding assistant: ask for one piece at a time, read and run what comes back, fix what's wrong, and have a version someone else can play by Friday.
Big idea

Ask, read, run, fix: coding with an assistant

Ask, read, run, fix

40 min
from the short lesson · Ask, Read, Run, Fix: Coding With an AI Assistant
Main ideas
  • Ask for one thing. "Draw a green square I can move with the arrow keys" works. "Make me a game" gets you someone else's game.
  • Give it what it can't see. Paste your code and the exact error. Say what you expected and what happened instead.
  • Read before you run. Say out loud what you think each new line does. If you can't, ask the assistant to explain that line.
  • Run it and check. Does it do what you asked, and only that? Did it change anything you didn't ask it to?
  • When it's wrong, say how. "The snake goes through the wall instead of ending the game" gets a better fix than "it's broken".
Know the ruleWho types?

Most AI tools are for ages 13 and up, and some need a parent's permission until 18. That is the company's rule, and we follow it. Under 13, your instructor types into the AI tool and you decide what to ask. You still read the code, run it and fix it, which is the skill.

Team huddle

Pairs, tools and the deadline

40 min
  • Welcome and logistics: fill in the intake survey, meet your partner or team, join the class chat.
  • Your coding space: Python, Pygame, the command line, where your files live, and which AI tool the class uses.
  • The month in one picture: build Snake, change its rules, let a bot play it, put it on the web for the arcade.
  • Friday's deadline: a Snake someone else can play.
  • Under 13: the instructor types into the AI tool for you, and you decide what to ask.
Build session

Python, fast, for the game you're about to build

Read the code before you run it

90 min
from the short lesson · Ask, Read, Run, Fix: Coding With an AI Assistant
Do thisPredict, then run

Ask the assistant for a short piece of Python: a list of five fruits printed in order, then a deque that drops the oldest item when a new one arrives. Before you run each one, write down what you think it will print. Then run it. Where you were wrong, ask the assistant why.

Quick checkThe assistant's snake walks through walls. What do you send it?
  • "It's broken, fix it"
  • Your movement code, and "when the head reaches the edge of the window the game should end, but the snake comes out the other side"
  • The whole file, with no message
For you

Keep a log as you go: what you asked, what it gave you, what you changed. It's one of the things you hand in.

Build session

Build Snake: window, food, a snake you control, collisions and score

Build single-player Snake

90 min
from the short lesson · Pygame: Frames, Colors and a Snake That Moves
Main ideas
  • The loop. Every frame: read the keys, move the snake one square, check for food and crashes, draw everything, wait.
  • The snake is a list of squares. Moving adds a square at the head and drops one at the tail. Eating skips the drop, so it grows.
  • Colours are numbers. (0, 200, 0) is green. Change them and you've changed the feel of the game.
Do thisBuild it in this order
  1. A window that opens, updates and closes.
  2. Food at a random square.
  3. A snake you steer with the arrow keys.
  4. Crashing into a wall or yourself ends the game.
  5. The score on screen, and a key to restart.
⌘Pygame documentationtool · Pygame · pygame.org ▶Train an AI to Play Snake (first 30 minutes build the game)video · freeCodeCamp · 30 min · youtube.com ▶PyGame Flappy Bird Beginner Tutorial, part 1video · Coding With Russ · 10 min · youtube.com
Short extras
prerequisite, self-paced
Practical Python in 10 Hours

AI Camp's own self-paced Python starter. Enough to read the code your assistant writes: variables, lists, loops, functions and classes.

Open it

AI Camp's 10-hour course is the prerequisite. It isn't public yet, so until it is, the official Python tutorial covers the same ground.

The Python Tutorialarticle · Python Software Foundation · 600 min · docs.python.org
15 min
The Command Line in Fifteen Minutes

Move between folders, run your game, and read an error, from a window where you type instead of click.

Open it
Main ideas
  • cd moves into a folder. ls (or dir on Windows) lists what's there.
  • python game.py runs your game. When it crashes, the last lines of the error say where.
  • The up arrow brings back the last command.
The Shellarticle · MIT Missing Semester · 15 min · missing.csail.mit.edu
10 min
Game State: What the Game Remembers Each Frame

Everything your game needs to draw the next frame: where the snake is, which way it's going, where the food is, the score. Name it, and bugs get easier to find.

Open it
Main ideas
  • The state is the list of facts that, if you saved them, would let you pause and resume the game.
  • Snake's state: the snake's squares (a deque), its direction (an Enum), the food's square, the score.
  • In week 3 the bot sees a small part of the state, chosen by you. What you leave out, it can't learn about.
collections: deque and namedtuplearticle · Python docs · 10 min · docs.python.org
10 min
How to Think About Picking a Major

From AI Camp's career topics: a major is a choice of what to practise for four years, not a life sentence. Ask people what their days are like.

Open it

The source asked: "How should we think about picking up a major?" Ten minutes, as a group.

Talk it through
  • What did you like doing this month: designing rules, writing code, watching players, or making it look good? Those point at different majors.
  • Who could you ask what their work day is like?
Help hour60 min

Bring the error message and the request that produced it. Leave with a game that runs.

On track by Friday
  • Your coding space runs Python and Pygame.
  • Your assistant log has at least five requests, each with what you got and what you changed.
  • Someone outside your pair can play your Snake: it moves, eats, grows, crashes and keeps score.
02Change the rulesChange the rules: name your game's mechanics, change one at a time on purpose, watch other people play, and by Friday have a version that's harder to put down.
Big idea

Game mechanics: rules, scoring, difficulty, feedback

What makes a game worth another go

40 min
from the short lesson · Game Mechanics: Rules, Scoring, Difficulty, Feedback
Main ideas
  • Goal and actions. What is the player trying to do, and what can they press?
  • Scoring. What earns points, what costs them, and can the player see why?
  • Difficulty. How does it get harder? Too slow and it's boring; too fast and it's unfair.
  • Feedback. How does the player know they did well? A sound, a flash, the screen shaking. Designers call this "juice".
  • Fun or frustrating. A player quits when they die and can't see why, or when nothing changes for a long time.
▶Secrets of Game Feel and Juicevideo · Game Maker's Toolkit · 12 min · youtube.com
Talk it through
  • Name a game you quit. What made you quit?
  • Name one you played "one more time" at midnight. What pulled you back?
Team huddle

One page, one change, one test

30 min
  • Before anyone changes code: write your game on one page. What is the goal, what can the player do, how do you score, how does it get harder, how does the player know they did well?
  • Change one rule at a time, ask the assistant for that change only, then have someone else play it.
  • Who owns which part of the code? Each person explains their part to the other before Friday.
  • Deadlines: the one-page design by Tuesday; one rule changed and played by three people by Thursday.
  • You can keep Snake and change it, or design your own small game on the same code.
Build session

Change one rule, watch someone play

Change one rule, playtest, write down what happened

90 min
from the short lesson · Game Mechanics: Rules, Scoring, Difficulty, Feedback
Do thisOne change, three players

Pick one rule: speed, points per apple, walls, how the snake grows. Ask the assistant for that change only. Then three people play it while you watch and don't talk. Write down where they hesitated, died, laughed or quit.

Quick checkPlayers keep dying in the first five seconds. What do you change first?
  • Add more points per apple
  • Start slower, and speed up as they score
  • Add a second snake
Build session

Your own game on one page

Design your own small game on the Snake code

90 min
from the short lesson · Your Own Game on the Snake Code
Do thisOne page first

Write your game on one page before you ask the assistant for anything: the goal, what the player can do, how they score, how it gets harder, and how they know they did well. Then list which parts of your Snake code stay and which change.

The Door Problemarticle · Liz England · 8 min · lizengland.com
Short extras
10 min
Game State: What the Game Remembers Each Frame

Everything your game needs to draw the next frame: where the snake is, which way it's going, where the food is, the score. Name it, and bugs get easier to find.

Open it
Main ideas
  • The state is the list of facts that, if you saved them, would let you pause and resume the game.
  • Snake's state: the snake's squares (a deque), its direction (an Enum), the food's square, the score.
  • In week 3 the bot sees a small part of the state, chosen by you. What you leave out, it can't learn about.
collections: deque and namedtuplearticle · Python docs · 10 min · docs.python.org
15 min
The Command Line in Fifteen Minutes

Move between folders, run your game, and read an error, from a window where you type instead of click.

Open it
Main ideas
  • cd moves into a folder. ls (or dir on Windows) lists what's there.
  • python game.py runs your game. When it crashes, the last lines of the error say where.
  • The up arrow brings back the last command.
The Shellarticle · MIT Missing Semester · 15 min · missing.csail.mit.edu
10 min
Information Interviews: What They Are and How to Run One

Twenty minutes with someone who does the job you're curious about, asking how they got there and what their days are like. You ask; they talk.

Open it

From the source's career topics: "What is an information interview?"

Main ideas
  • Ask for twenty minutes, by message, through someone who knows them.
  • Bring five questions. How did you start? What does a normal day look like? What do you wish you'd learned earlier?
  • Send a thank-you the same day.
Informational interviewarticle · Wikipedia · 5 min · en.wikipedia.org
Know the ruleSafety

Under 18, a parent sets up the interview and knows when and where it happens. Video calls count.

leads toInformation Interview With Someone Who Makes Games

Help hour60 min

Bring the change that made your game worse. We'll work out why.

On track by Friday
  • Your game is written on one page: goal, actions, scoring, difficulty, feedback.
  • At least one rule changed and played by three people who aren't you.
  • Every change is in your log, with what players did.
03Let a bot play itLet a bot play: plug in a bot that learns your game by trying and getting points, see what it finds, close the loopholes, and have people play the fixed version by Friday.
Big idea

A bot that learns by trying and getting points

Rewards, not instructions

40 min
from the short lesson · A Bot That Learns by Trying and Getting Points
Main ideas
  • It sees, it moves, it gets points. Each turn the bot sees a little of the game (is there danger ahead, which way is the food), picks a move, and gets a rewardWe call this: rewardThe points the computer player gets or loses after a move. The team decides what earns them.Draft wording, for Michael to correct: points for good things, lost points for bad ones.
  • At first it guesses. Early on it tries random moves to find out what happens. Later it mostly picks what worked before. Getting that balance right is most of the craft.
  • It does what pays, not what you meant. If your scoring has a gap, the bot finds it, because it has nothing else to go on.
▶An introduction to Reinforcement Learningvideo · Arxiv Insights · 16 min · youtube.com ▶Multi-Agent Hide and Seekvideo · OpenAI · 3 min · youtube.com
Quick checkA bot gets 10 points for food and loses 10 for crashing. It learns to circle forever. Why?
  • It is broken
  • Circling never crashes, so it never loses points, and finding food was harder than staying alive
  • It is bored
Team huddle

Plug your game into the bot kit

40 min
  • The bot kit needs four things from your game: start a new game, take one move, say what the bot can see, and say how many points that move earned.
  • Ask the assistant to add those four to your game, then read every line it adds.
  • Deadline: your bot has played at least 200 games of your game by Wednesday.
  • Friday: people play the version you fixed.
Build session

What did the bot find?

Let the bot play, then read what it did

90 min
from the short lesson · A Bot That Learns by Trying and Getting Points
Do thisWatch, then log

Watch replays of your bot's best game and its strangest one. Read its score chart. For each surprise, write: what the bot did, which rule let it, and whether it's a loophole (it scores without playing the game you meant) or a strategy (a smart way to play).

Build session

Close the loophole, then test with people

Change the rules, retrain, playtest again

90 min
from the short lesson · Loopholes: When the Bot Breaks Your Rules▶9 Examples of Specification Gamingvideo · Robert Miles · 10 min · youtube.com Faulty reward functions in the wildarticle · OpenAI · 5 min · openai.com
Do thisFix one, test twice

Change one rule to close one loophole. Retrain the bot and check the loophole is gone. Then have three people play the new version. Write down both results.

Talk it through
  • Is every surprise a loophole? When is the bot just playing better than you?
  • Your fix stopped the bot. Did it make the game worse for people?
Short extras
10 min
Reading a Training Curve

A chart of the bot's score, game after game. Up is learning. Flat is stuck. A sudden jump is often a loophole.

Open it
Main ideas
  • Plot the score of every game, and the average of the last 20. The average is the line to read; single games bounce.
  • Flat for hundreds of games: the bot isn't seeing what it needs, or the rewardWe call this: rewardThe points the computer player gets or loses after a move. The team decides what earns them.Draft wording, for Michael to correct is too rare.
  • A sudden jump: check the replay. It may have learned something clever, or found a loophole.
Pyplot tutorialarticle · Matplotlib · 15 min · matplotlib.org
15 min, optional
Deep Q-Learning, and Exploration vs. Exploitation

How the bot keeps score of its moves: a table, or a small network, that guesses how many points each move will earn. And why it sometimes tries a move it thinks is worse.

Open it

From the source's week 2 lecture list. Optional in the base month; core on the challenge path.

Main ideas
  • Q-value: the bot's guess of how many points a move will lead to, from here. Q-learning updates that guess after every move.
  • Deep Q: when there are too many situations for a table, a small neural network makes the guess instead.
  • Explore or exploit: a bot that only repeats what worked never finds anything better; one that only experiments never gets good. Most bots explore a lot early and less later.
▶Q Learning Intro/Tablevideo · sentdex · 20 min · youtube.com
Talk it through

Where do you make the same trade-off: order your usual, or try something new?

10 min, optional
The Bracket: Rules for Snake vs. Snake

Teams' trained bots meet two at a time on one shared Snake board, March Madness style. The winner of each match moves on.

Open it

The source listed the bracketWe call this: bracketThe tournament: teams' computer players meet two at a time, and the winner moves on, like March Madness.Draft wording, for Michael to correct rules as unfinished. These are a first draft for the challenge path, or for an optional bot showdown at the arcade.

Main ideas
  • One shared board, written by the instructors. Every bot sees the same inputs and picks from the same moves; each team chooses its own rewards.
  • A match is best of five games. A game ends when one snake crashes, or after 1,000 moves, when the longer snake wins.
  • Seeding by each bot's average score over 100 solo games.
  • Bots are submitted as saved weights, never as code.
Help hour60 min

Bring the strangest thing your bot did.

On track by Friday
  • Your bot has played at least 200 games of your game.
  • You've written down at least one thing the bot did that you didn't expect, and whether it was a loophole.
  • At least one change made, the bot retrained, and three people played the new version.
04Ship it to the arcadeShip it and show it: put your game on a web page anyone can open, run a table at the demo-day arcade, and explain what you changed and why.
Big idea

From your laptop to anyone's browser

From a game on your laptop to a page anyone can play

40 min
from the short lesson · Requests and Responses: Putting a Game on the Web
Main ideas
  • Request, response. The browser asks, a server answers with files. For a game, those files are the game.
  • Static is enough. A game that runs in the browser needs no server code. Any host that serves files will do.
  • A server when you need one. A shared high-score table or a bot that runs on a big computer needs a server that answers requests. That's the challenge path's Flask week.
⌘pygbag: Pygame in the browsertool · pygame-web · pygame-web.github.io Uploading HTML5 gamesarticle · itch.io · 8 min · itch.io
Team huddle

Freeze, ship, rehearse

40 min
  • Choose the version you'll ship. No new features after Monday.
  • Split the work: one person gets it running in a browser, one writes the "how to play" screen and the page, one runs the rehearsal.
  • Deadline: your game opens and plays in a browser by Thursday.
  • Demo day: each pair runs a table at the arcade, families play, and you explain one rule you changed and why.
Build session

Ship it, one step at a time

Get it running in a browser

90 min
from the short lesson · Requests and Responses: Putting a Game on the Web
Do thisThree steps, in order
  1. Package the plain game for the browser and open it locally.
  2. Add the score screen and the "how to play" text.
  3. Put the folder on the class game page, and open the link on a computer that isn't yours.
Know the rulePublishing

Your game goes on a class page, not a public account in your name. Under 13, the instructor uploads it. Don't put your full name, school or photo in the game.

Build session

Prepare the arcade table

Rehearse, then score yourselves

90 min
from the short lesson · Show It: The Demo-Day Arcade
Do thisYour table in three parts
  1. Thirty seconds: how to play, said to someone who has never seen it.
  2. One story: a rule you changed, what players or the bot did, and what you changed next.
  3. The bot screen: what it learned, and one loophole it found.
Do thisScore yourselves

Swap tables with another pair. Play their game, listen to their story, and score it with the demo-day score sheet. Then they score yours.

For you

Let them play before you explain. Most people learn a game faster by losing once.

Short extras
15 min
Requests and Responses: Putting a Game on the Web

A browser asks for files and runs them. Package your Pygame game so a browser can run it, put it on a free game host, and send someone the link.

Open it

When you open a web page, your browser sends a request and a server sends back a response: the page and its files. A game can travel that way too. Your browser downloads it and runs it on your own computer.

From a game on your laptop to a page anyone can play

40 min
Main ideas
  • Request, response. The browser asks, a server answers with files. For a game, those files are the game.
  • Static is enough. A game that runs in the browser needs no server code. Any host that serves files will do.
  • A server when you need one. A shared high-score table or a bot that runs on a big computer needs a server that answers requests. That's the challenge path's Flask week.
⌘pygbag: Pygame in the browsertool · pygame-web · pygame-web.github.io Uploading HTML5 gamesarticle · itch.io · 8 min · itch.io

Get it running in a browser

90 min
Do thisThree steps, in order
  1. Package the plain game for the browser and open it locally.
  2. Add the score screen and the "how to play" text.
  3. Put the folder on the class game page, and open the link on a computer that isn't yours.
Know the rulePublishing

Your game goes on a class page, not a public account in your name. Under 13, the instructor uploads it. Don't put your full name, school or photo in the game.

leads toPlayable in a Browser

15 min, optional
Neural Network Architectures, a Tour

From the source's week 3 lecture: the small network inside a bot, and how it relates to the networks that read images and text.

Open it ▶But what is a neural network?video · 3Blue1Brown · 19 min · youtube.com
Main ideas
  • A network is layers of numbers that turn an input (what the bot sees) into an output (how good each move looks).
  • Different shapes suit different inputs: grids of pixels, sequences of words, small lists of facts like the bot's.
10 min
Information Interviews: What They Are and How to Run One

Twenty minutes with someone who does the job you're curious about, asking how they got there and what their days are like. You ask; they talk.

Open it

From the source's career topics: "What is an information interview?"

Main ideas
  • Ask for twenty minutes, by message, through someone who knows them.
  • Bring five questions. How did you start? What does a normal day look like? What do you wish you'd learned earlier?
  • Send a thank-you the same day.
Informational interviewarticle · Wikipedia · 5 min · en.wikipedia.org
Know the ruleSafety

Under 18, a parent sets up the interview and knows when and where it happens. Video calls count.

leads toInformation Interview With Someone Who Makes Games

10 min
How to Think About Picking a Major

From AI Camp's career topics: a major is a choice of what to practise for four years, not a life sentence. Ask people what their days are like.

Open it

The source asked: "How should we think about picking up a major?" Ten minutes, as a group.

Talk it through
  • What did you like doing this month: designing rules, writing code, watching players, or making it look good? Those point at different majors.
  • Who could you ask what their work day is like?
Help hour60 min

Shipping clinic. Bring the error from the browser console.

On track by Friday
  • Your game version is frozen by Monday.
  • Your game opens and plays in a browser by Thursday, on a computer that isn't yours.
  • Each person has said their part of the arcade pitch out loud once.

How each piece is scored

Every piece has a score sheet: a few plain words for good work, and the details we look for. Here is the scale.

0.0Needs FocusNot started, or not sure what the task is.
1.0Needs InitiativeStarted, but not a full attempt yet.
2.0Needs EffortClose. More time would get it there.
3.0SuccessfulIt works, and you can say why.
4.0ExcellentIt works, and you went past what we asked.
5.0RemarkableYou tried something we didn't think of, and it taught the room something.
6.0AwesomeNext cohort gets shown this one.

Rules for AI tools

You start with Snake, a game everyone knows. You build it from an empty file with an AI coding assistant: you say what you want, it writes code, you run it, and you fix what comes back wrong. By Friday of week 1 someone else can play it.

Then you change how it works. Speed, scoring, walls, a second snake, or a small game of your own. Friends play it and tell you where it got boring or unfair. In week 3 a bot that learns by trying and getting points plays your game thousands of times, and if your rules have a loophole, it finds it. In week 4 you put the game on a web page, and families play it at the demo-day arcade.

For you

You don't need to be good at Python yet. You need to be willing to read the code your assistant writes, run it, and ask why when it breaks. The 10-hour Practical Python course helps, and you can do it alongside week 1. Under 13, your instructor or a parent types into the AI tool and you tell them what to ask.

Pacing

Relative time only, in [[pac-rlsnk1|Pacing: Game Mechanics]]. Deliverable bars are read from each Deliverable's own pacing.

ATACCWe call this: ATACCApproach → Thought → Animation → Craft → Content. Feedback starts with how the work was done and ends with what was understood.Michael’s words across the BurstWe call this: BurstOne month of AI Camp: four weeks, ending in a demo day for families.Michael’s words

The procession lines up with the month.

WeekLayer in focusWhy here
1ApproachDo they set up their tools, ask the assistant for one piece at a time, and ask a person when stuck?
2ThoughtCan they say what rule they changed, why, and what they expect players to do?
3Animation, CraftDo they keep testing after the bot finds a loophole, and does each fix go in the log?
4ContentCan they explain to a family member why their game is fair and how the bot learned it?
← curricula-v