Make a Game Mission with Claude Code

Use Claude Code to build and record an original browser game mission.

Introduction

30 Second Summary

A game idea can feel complete in your head, yet turning it into something playable is where momentum disappears. Even a short mission needs several pieces to work together before anyone can play it.

In this project, you will use vibe coding with Claude Code to turn a one-page plan into an original browser game. Your finished playthrough becomes a mission recording you can share.

What You'll Build

Picture driving through your own city mission as each stop unfolds into dialogue, a startup launch, an investor pitch, and a counted reward.

By the end of this project, you'll have:

  • A mission plan in mission.md that you can use to check the game's objectives, dialogue, pitch choices, and reward.
  • An original one-file city game that opens from index.html. The arrow keys or WASD move the car while buildings block its path.
  • A complete mission recording of your successful playthrough. It shows the reward count to $10,000,000 before Enter starts the game again.
  • Secret Mission: Add a timed three-stop follow-up mission that plays a generated mission-passed jingle when you beat the countdown.

Are there any prerequisites?

You need a Claude plan that includes Claude Code, internet access, a keyboard, and a supported Mac or Windows PC. No coding experience is required.

Before We Start

First, lock in the original story mission you want to make and why it matters to you. Your mission follows you building an app with a co-founder, pitching investors, and earning a reward.

Install Claude Code

Your first command-line session needs a verified Claude Code installation inside a safe empty folder before any files are created.

The launch folder becomes Claude's working directory. Manual mode keeps each future file change behind an approval.

In this step, get ready to:
  • Install Claude Code 2.1.336.
  • Create the my-mission project folder.
  • Start a Manual mode project session inside my-mission.
Install Claude Code

Claude Code installs through Terminal on macOS or Windows PowerShell on Windows. The native installer gives you the claude command used throughout the project.

macOS

  • Press Cmd+Space to open Spotlight.
  • Type Terminal.
  • Press Return to open Terminal.
  • Install Claude Code by running this command:
curl -fsSL https://claude.ai/install.sh | bash

What does this command do?

  • The curl command downloads the native installer from Claude.
  • The -fsSL options keep the download focused on the installer response.
  • The bash command runs the downloaded installer.

The download can pause briefly while Claude Code is installed. A short wait here is normal.

  • Restart Terminal so the new command is available.
  • Close the current Terminal window.
  • Press Cmd+Space to open Spotlight.
  • Type Terminal.
  • Press Return to open a fresh Terminal window.

You should see a fresh Terminal prompt.

  • Check the installed Claude Code version by running this command:
claude --version

What does this command do?

The --version option asks Claude Code to print its installed version. This confirms that the terminal can find the command.

You should see version 2.1.336.

Windows

  • Select Start.
  • Type PowerShell.
  • Press Enter to open Windows PowerShell.
  • Install Claude Code by running this command:
irm https://claude.ai/install.ps1 | iex

What does this command do?

  • The irm command downloads the native installer from Claude.
  • The iex command runs the downloaded installer in Windows PowerShell.

The download can pause briefly while Claude Code is installed. A short wait here is normal.

  • Restart Windows PowerShell so the new command is available.
  • Close the current Windows PowerShell window.
  • Select Start.
  • Type PowerShell.
  • Press Enter to open a fresh Windows PowerShell window.

You should see a fresh Windows PowerShell prompt.

  • Check the installed Claude Code version by running this command:
claude --version

What does this command do?

The --version option asks Claude Code to print its installed version. This confirms that Windows PowerShell can find the command.

You should see version 2.1.336.

✔️ I see the expected version

Claude Code 2.1.336 is installed. Your command line is ready for the project folder.

ⓧ I see an older version

The existing installation needs an update before you continue.

  • Repeat the native installer command shown in your operating-system tab.
  • Restart Terminal or Windows PowerShell.
  • Repeat the version check shown above.

Use the official Claude Code setup guide if the older version remains active.

ⓧ Command not found

The command line cannot find the installation yet.

  • Repeat the native installer command shown in your operating-system tab.
  • Close Terminal or Windows PowerShell.
  • Open a fresh Terminal or Windows PowerShell window.
  • Repeat the version check shown above.

Follow the official Claude Code setup guide if the command remains unavailable.

Create the project folder

Claude uses its launch directory as the primary working directory. An empty my-mission folder keeps the upcoming plan and game together.

  • Create the empty my-mission folder by running this command:
mkdir my-mission

What does this command do?

The mkdir command creates a local directory named my-mission. It starts empty so Claude cannot mix the game with unrelated files.

  • Enter my-mission by running this command:
cd my-mission

What does this command do?

The cd command changes the current directory to my-mission. Claude uses this location when the project session starts.

Both commands should finish without an error. The session check in the next substep confirms the current folder.

✔️ Awesome, I've got everything!

Great. The empty my-mission folder is now your current directory.

ⓧ I'd like to double check the full code

There is no project code yet. The my-mission folder contains no mission.md or index.html file.

Start the project session

Starting Claude from my-mission anchors the project session to that folder. Manual mode then lets you review each file change before it happens.

  • Start Claude Code from my-mission by running this command:
claude

What does this command do?

The claude command starts an interactive project session. Claude treats my-mission as its primary working directory.

The browser sign-in connects this terminal session to the Claude access you already have. Your account credentials stay in the sign-in flow.

  • Complete the browser login prompt with your Claude account.
  • Follow the browser prompt until the project session appears in Terminal or Windows PowerShell.

You should see an active Claude Code session in the command line.

The status line is easy to miss because it sits at the edge of the session. Check it before you ask Claude to create anything.

  • Set the project session to Manual mode by pressing Shift+Tab once if the status line shows auto mode.

You should see manual mode on in the status line.

Before you send the check, predict which folder Claude will name.

  • Check the project session by pasting this message exactly:
Say hi and tell me which folder you're working in.

What does this message check?

The message asks Claude to report its current working folder without changing any files. The reply confirms that the session started from the intended directory.

Claude should name my-mission in its reply. That confirms your project session is working in the correct folder.

Claude creates no file request, so there is nothing to approve. There is no game tab to reload.

Claude command not available?

  • Close Terminal or Windows PowerShell.
  • Open a fresh Terminal or Windows PowerShell window.
  • Repeat the claude command from my-mission.

If the command still fails, help me diagnose why Claude Code is unavailable after the native installation.

  • Run Claude Code's read-only installation check with this command:
claude doctor

What does this diagnostic command do?

The claude doctor command prints read-only installation and settings diagnostics. It helps identify why the command or session is unavailable.

Your empty project folder now has a verified Claude Code session in Manual mode. Next, you will turn your story idea into mission.md.

Write Your Mission Plan

Your active Claude Code project session is ready for mission design.

A one-page mission plan gives Claude a stable source for the objectives, places, dialogue, choices, and reward before the game exists.

In this step, get ready to:
  • Create the one-page mission plan.
  • Personalize one dialogue line.
  • Verify the mission plan against its required story beats.
1. Lock in the story shape

The fixed story shape connects the diner scene to the investors' office. The reward gives the mission a clear ending.

  • Ask Claude to turn the fixed story into mission.md by sending this exact message:
Write mission.md, a plan for a short open-world style mission. Title: Vibe Coded. Objective 1: drive to the diner and vibe code a startup with your co-founder. Objective 2: drive to the investors' office and pitch it. Reward: Mission passed! $10,000,000. Write 4 to 6 dialogue lines for each scene, funny, about building an app with AI. In the pitch, the investors ask 3 questions with 3 answers each; one wrong answer fails the mission. Keep it to one page.

What does this prompt do?

  • The title and objectives establish the complete route from the diner to the investors' office.
  • The dialogue requirements give each scene enough material for the game.
  • The pitch choices create a success path and a wrong-answer failure path.
  • The reward fixes the final payoff at Mission passed! $10,000,000.
  • Select the message field at the bottom of the project session.
  • Paste the message exactly as shown.
  • Press Enter to send it.

Claude reads the request and asks to create mission.md.

  • Review the proposed mission plan in the file request.
  • Confirm the request lists only mission.md.
  • Approve only the proposed creation of mission.md.
  • Use the approval control attached to the mission.md file request.

You should see Claude confirm that mission.md was created.

No game tab exists yet, so there is no tab to reload.

Claude started writing code?

  • Return Claude to the mission plan by sending this exact message:
Only the plan for now, no code.

Claude should return to editing only mission.md.

If the scope still includes game files, ask for help checking the project session.

2. Add your voice

The plan now has the required structure. One personalized line makes the co-founder scene sound closer to your own voice.

  • Ask Claude to revise exactly one dialogue line in mission.md by sending this exact message:
Change one dialogue line in mission.md so it sounds more like me, then show me the changed line.

What does this prompt do?

The prompt limits the edit to one dialogue line. It also asks Claude to show the replacement so you can review the change before moving on.

  • Select the message field at the bottom of the project session.
  • Paste the message exactly as shown.
  • Press Enter to send it.

Claude asks to edit mission.md and shows the replacement line.

  • Read the proposed replacement line in the file request.
  • Confirm the request changes only mission.md.
  • Approve only the proposed edit to mission.md.
  • Use the approval control attached to the mission.md edit request.

You should see the replacement line in Claude's reply. The same line now appears in mission.md.

There is still no game tab to reload.

3. Audit the plan

A checklist exposes any missing story beat before the game is created. This keeps the next step focused on the playable city.

Before you ask, do you expect every required mission detail to appear in Claude's checklist?

  • Ask Claude to audit mission.md by sending this message:
Read mission.md back as a checklist. Confirm the title is Vibe Coded. Confirm there are two objectives. Confirm both dialogue scenes are present. Confirm there are three pitch questions with three answers each. Confirm a wrong answer fails the mission. Confirm the deal dialogue is present. Confirm the reward is Mission passed! $10,000,000. Include the dialogue line I changed.

What does this prompt do?

The prompt asks Claude to inspect the saved plan without changing it. Each checklist item maps to a required part of the game story.

  • Select the message field at the bottom of the project session.
  • Paste the audit message exactly as shown.
  • Press Enter to send it.

Claude reads mission.md without requesting another file creation or edit.

You should see a checklist covering Vibe Coded, both objectives, both dialogue scenes, all three pitch questions, all nine answers, the failure path, the deal dialogue, the personalized line, and the Mission passed! $10,000,000 reward.

That is the planning work complete. Your story now has every beat Claude needs to build the first playable version.

Your personalized mission plan is ready. Next, you will turn it into a city with a car you can drive.

Build the City and Car

Your one-page mission plan now holds the story that guides the game. Next, you'll use Claude Code to turn that plan into a city you can drive through.

This first playable HTML Canvas and plain JavaScript version deliberately stops at Objective complete. That visible dead end exposes the missing diner scene before the next step adds it.

In this step, get ready to:
  • Direct Claude Code to create the playable city.
  • Launch index.html in the game tab.
  • Test the driving controls, building collisions and diner checkpoint.
1. Create the first playable game

Claude Code can use mission.md as the source for the two locations and current objective. This prompt fixes the required controls while leaving the city layout and colours open to variation.

  • Ask Claude Code to read mission.md and create index.html by pasting this message in the project session:
Read mission.md. Build index.html, one file with an HTML canvas and plain JavaScript, no libraries and no other files. Draw a top-down city: grey roads in a grid, green blocks between them, a diner and an investors' office as labelled buildings at opposite corners. The player is a car I drive with the arrow keys or WASD, and it can't drive through buildings. Show the current objective at the top of the screen and a glowing marker at the diner. When the car reaches the marker, show "Objective complete" for now.

What does this prompt do?

  • The prompt makes mission.md the source for the game locations and first objective.
  • The single index.html file contains the canvas, rendering logic and keyboard behavior.
  • The driving controls, building collisions, objective bar and exact checkpoint text become the acceptance criteria.

Claude reads mission.md and asks to create index.html.

  • Review the proposed index.html file.
  • Approve that one file creation.

Claude confirms that index.html was created inside my-mission. You now have the first runnable slice of your game.

2. Launch the game file

The game is self-contained inside index.html. Your operating system can hand that local file directly to its associated browser.

macOS

  • Switch back to Terminal from earlier.
  • Press Cmd+N to create a second Terminal window.

Windows

  • Select Start.
  • Type PowerShell.
  • Press Enter to create another Windows PowerShell window.

macOS

  • Move into the existing my-mission folder by running this command:
cd my-mission

What does this command do?

The cd command changes the second Terminal window's current location to my-mission.

  • Launch the local game file by running this command:
open index.html

What does this command do?

The open command sends index.html to the app associated with local HTML files.

Windows

  • Move into the existing my-mission folder by running this command:
cd my-mission

What does this command do?

The cd command changes the second Windows PowerShell window's current location to my-mission.

  • Launch the local game file by running this command:
start index.html

What does this command do?

The start command opens index.html with the app associated with local HTML files.

You should see a top-down city, a player car, the first objective and a glowing marker at the diner in the game tab.

3. Test the city checkpoint

The first test covers keyboard events and collision detection. Together, they prove the car responds to input while the buildings remain solid.

Before you reach the diner, do you think the mission plan alone is enough to make its dialogue appear?

  • Drive the car around the roads with the arrow keys.

You should see the car move in each direction while the current objective remains visible at the top.

  • Drive the car with W, A, S and D.

You should see the same movement with the second control set.

  • Drive the car into the edge of a building.

You should see the car stop at the building instead of crossing through it.

  • Drive the car into the glowing diner marker.

You should see Objective complete. The diner dialogue does not begin.

Your first playable checkpoint works: the car can navigate the city without crossing buildings.

The dead end after Objective complete is intentional. It proves the city slice works while exposing the next missing game state.

If it fails

  • Send this correction in the project session if the car only moves after the game tab is clicked:
Listen for the driving keys on the whole window so the car moves without clicking the page first.

This asks Claude Code to move keyboard listening to the whole window. Claude asks to edit index.html.

  • Approve the requested index.html edit.
  • Reload the game tab.

You should see the car respond before you click the page. Help me troubleshoot the window-level driving controls.

  • Send this correction in the project session if the arrow keys scroll the page:
Stop the arrow keys from scrolling the page while they control the car.

This asks Claude Code to prevent the browser's scrolling behavior for the driving keys. Claude asks to edit index.html.

  • Approve the requested index.html edit.
  • Reload the game tab.

You should see the arrow keys move only the car. Help me troubleshoot the arrow-key scrolling behavior.

Your car now drives through a playable city and stops at the diner checkpoint. Next, you'll replace that dead end with the diner dialogue and coding scene.

Add the Diner Scene

Your first playable route is working. The car reaches the diner while the buildings keep it on the roads.

The diner still ends at Objective complete, leaving the story with no dialogue, coding sequence, or route to the investors' office.

In this step, get ready to:
  • Add speaker-labelled diner dialogue and fake coding progress.
  • Play the diner scene through the second objective.
  • Personalise one status joke without changing the controls.
1. Add dialogue and coding progress

The next game state begins after Objective complete. Claude Code can reuse the dialogue in mission.md while keeping the game inside index.html.

  • Add the diner scene to index.html by sending this message in the project session:
At the diner marker, stop the car and play the diner dialogue from mission.md in a box at the bottom of the screen, one line at a time, with the speaker's name. Space shows the next line. Then show a fake code editor full screen: a prompt line "> build me a startup. make it viral. no bugs.", a SHIPPED bar that fills from 0 to 100%, and a funny status line every few seconds, like "Spawned 12 subagents to center a div". At 100% show "Shipped!", then set objective 2 and move the marker to the investors' office.

What does this prompt do?

  • The prompt tells Claude Code to use the existing diner dialogue from mission.md.
  • The arrival now leads into dialogue before the coding scene begins.
  • The completed coding scene activates the investors' office objective.

Claude should read mission.md and ask to edit index.html.

  • Approve only the proposed edit to index.html.
  • Read the proposed change in the project session.
  • Use the approval option shown beneath the proposed index.html edit.

Claude should confirm that index.html was updated. The my-mission folder should still contain only mission.md and index.html.

  • Reload the game tab.
  • Switch back to the game tab from earlier.
  • Use the browser's reload control.

You should see the city reset to the first objective. The diner marker should glow in its original location.

2. Play through the diner scene

The diner sequence moves through arrivalDiner, dialogue, coding, shipped, and driveOffice. Testing each transition catches a broken handoff before the investor pitch is added.

  • Drive the car to the diner marker with the arrow keys or WASD.

You should see Objective complete briefly. Speaker-labelled dialogue should then replace the checkpoint.

  • Press Space once for each dialogue line.

Each press should reveal one new line without moving the car or scrolling the page. The full-screen coding scene should begin after the final line.

  • Wait for the SHIPPED bar to reach 100%.

You should see > build me a startup. make it viral. no bugs. above the progress bar. The status line should change every few seconds.

At 100%, you should see Shipped! before the objective and glowing marker move to the investors' office. That's the full diner sequence working from arrival to departure.

3. Personalise the status joke

A focused status-line edit tests whether Claude Code preserves the working controls and required messages. The exact joke also gives you a visible result to verify.

  • Replace one status joke in index.html by sending this message in the project session:
Replace one diner status joke with: "The co-founder says the coffee is now part of the tech stack." Keep every control and required on-screen message unchanged.

What does this prompt do?

  • The first sentence replaces one diner status joke with the required line.
  • The second sentence protects every existing control and required on-screen message.

Claude should ask to edit index.html.

  • Approve only the proposed edit to index.html.
  • Read the proposed change in the project session.
  • Use the approval option shown beneath the proposed index.html edit.

Claude should confirm that the status joke was replaced without creating another file.

  • Reload the game tab.
  • Switch back to the game tab.
  • Use the browser's reload control.

Before you replay the scene, do you expect the new joke to appear while the dialogue controls stay unchanged?

  • Drive the car to the diner marker.
  • Press Space once for each dialogue line.
  • Watch the coding scene until the personalised status line appears.

You should see The co-founder says the coffee is now part of the tech stack. while the SHIPPED bar fills. Space should still advance only the dialogue.

You should then see Shipped! before the investors' office objective appears. Your personalised diner scene now reaches the second objective.

If It Fails: Space Drives or Scrolls

If Space moves the car or scrolls the page during dialogue, ask Claude Code to isolate the scene controls.

  • Correct the keyboard behaviour by sending this message in the project session:
Ignore driving keys while dialogue or the coding scene is open, and stop Space from scrolling the page.

This asks Claude Code to disable driving while an overlay is active. It also keeps Space from triggering the browser's scrolling behaviour.

  • Approve only the proposed edit to index.html.
  • Reload the game tab.
  • Replay the diner dialogue with Space.

Use the approval option beneath the proposed edit. Then use the browser's reload control in the game tab.

You should see one new dialogue line per press. Help me fix the diner scene controls.

Your diner now turns the first destination into a complete story sequence. Next, you will make the investors' office test the player's pitch.

Add the Investor Pitch

Your diner scene now ships the startup before pointing the car toward the investors' office. Next, Claude Code turns that office into a playable pitch from mission.md.

A deliberately wrong answer exposes the Mission failed game state before a successful run proves that retry and completion are separate paths.

In this step, get ready to:
  • Add the three-question investor pitch.
  • Trigger a failed answer and retry the pitch.
  • Complete the pitch through Deal!.
Add the pitch to the investors' office

The existing mission plan already holds the questions and answer choices. This request tells Claude to turn that plan into an interactive sequence with failure and deal states.

  • Send the investor-pitch request in the project session by pasting this prompt:
At the investors' office marker, play the pitch from mission.md. Each investor question shows its 3 answers; I pick with the 1, 2 or 3 keys. A wrong answer shows "Mission failed" with the reason and lets me press R to retry from the office. If every answer is right, the investors offer "$10,000,000 for 10%. Do we have a deal?" and the player counters: "Make it a hundred million valuation and you got a deal." They reply "Deal!"

What does this prompt do?

  • Claude reads the three investor questions from mission.md.
  • The numbered keys select one answer for the current question.
  • The failure path stores a reason before R restarts the pitch.
  • The successful path moves through the offer and counter before showing Deal!.

Claude should read mission.md and ask to edit index.html.

  • Approve the proposed edit to index.html in Manual mode.
  • Review the proposed changes to confirm that Claude is editing only index.html.
  • Use the approval option shown beneath the proposed edit.

Claude should confirm that index.html was updated. The my-mission folder should still contain only mission.md and index.html.

  • Reload the game tab.
  • Use the reload control beside the game tab's address bar.

You should see the game restart with the first driving objective.

  • Complete the diner scene by pressing Space once for each dialogue line.
  • Drive to the investors' office marker with the arrow keys or WASD.

You should see the first investor question with three numbered answers. This proves the office marker now starts the pitch.

Fail once and retry the pitch

Playtesting the failure route proves that a wrong answer has its own visible result. It also confirms that retry returns to the office without restarting the diner sequence.

Before choosing an answer, which option do you expect will trigger the failure path?

  • Press one 1, 2, or 3 key once for an answer you think is wrong.

You should see Mission failed with a reason. One key press should select only that answer.

  • Press R to retry from the office.

You should see the first investor question again. The car should remain at the office.

Does one key press select multiple answers?

  • Send this correction in the project session:
Accept only one press of 1, 2 or 3 per investor question, then wait for the next question before accepting another answer.

This asks Claude to process one numbered key press for the current question. Claude should ask to edit index.html.

  • Approve the proposed edit to index.html.
  • Reload the game tab.
  • Return to the investors' office.
  • Press one numbered answer key once.

You should see one answer selected before the next question accepts another key press. Help me diagnose repeated answer selections in this investor pitch.

Complete the successful pitch

Before your successful run, what do you expect to see after the third correct answer?

  • Choose the correct answer to each of the three questions with one press of 1, 2, or 3.

You should see $10,000,000 for 10%. Do we have a deal? after the third correct answer.

  • Press Space once to advance the deal dialogue.

You should see Make it a hundred million valuation and you got a deal. as the player's counter.

  • Press Space again to show the investor's response.

You should see Deal! on screen. That is the hardest interaction done. Your pitch now moves cleanly from failure to retry to a successful deal.

Your investor pitch now handles wrong answers and retries. Next, you will add the counted reward before capturing a complete mission recording.

Win the Mission and Record It

Your investor pitch now has separate failure and success paths. The final scene turns that successful deal into a complete mission you can replay and share.

A finished route resolves the earlier failed pitch with a counted reward, an Enter replay control, a plan check, and a saved screen recording.

In this step, get ready to:
  • Direct Claude Code to add the completed mission ending.
  • Playtest the full route against mission.md.
  • Capture the complete route in the mission recording.
1. Add the completed ending

The pitch currently stops at Deal!. The new game state turns that agreement into a visible reward before replay becomes available.

  • Send the completed-ending request in the project session by pasting this prompt:
After "Deal!", show a full-screen "Mission passed!" in big yellow letters, then count the money up from $0 to $10,000,000 under it, then the line "You raised a $10M seed round for your vibe coded startup." Press Enter to play again from the start.

What does this prompt do?

  • The prompt adds the passed state after the existing deal sequence.
  • The passedAt value gives drawPassed a starting point for the three-second money animation.
  • The Enter handler calls the existing reset behavior after the counter finishes.

Claude asks to edit index.html.

  • Approve Claude's proposed edit to index.html.
  • Review the proposed change in the project session.
  • Use the approval control beside the index.html edit.

Claude confirms that index.html now contains the completed ending.

  • Reload the game tab.
  • Switch back to the game tab from earlier.
  • Use the browser's reload control.

You should see the first objective again, which confirms the reloaded game can start a new route.

  • Play through the existing route until the investors say Deal!.

Before you continue from Deal!, predict whether the reward will jump straight to its total or count upward.

  • Press Space after Deal! to continue into the completed ending.

You should see Mission passed! in large yellow letters. The money counter should climb smoothly from $0 to $10,000,000 over about three seconds.

You should then see You raised a $10M seed round for your vibe coded startup. The replay instruction should appear after the count completes.

Money counter jumps to the end?

  • Send this correction in the project session:
Make the money counter animate smoothly from $0 to $10,000,000 over about three seconds before Enter can restart the game.

This prompt asks Claude to preserve the reward total while spreading the visible count across about three seconds.

  • Approve Claude's edit to index.html.
  • Reload the game tab.

You should see the counter animate before Enter can restart the game. Help me troubleshoot the reward animation.

2. Playtest the complete route

A complete playtest checks every transition in one continuous route. Comparing it with mission.md keeps the built game aligned with the story you approved.

  • Press Enter after the reward reaches $10,000,000.

You should return to the first objective with the car at its starting position.

  • Drive to the diner with the arrow keys or WASD.
  • Advance the diner dialogue with Space.
  • Wait for the coding bar to reach 100%.
  • Drive to the investors' office.
  • Answer all three pitch questions with 1, 2, or 3.
  • Advance the deal dialogue with Space.
  • Compare every scene with mission.md.

You should see the diner dialogue lead into the coding sequence. You should then see Shipped! before the investors' office becomes the current objective.

The pitch should end at Deal!. The completed ending should finish at Mission passed! with the full reward count.

  • Report any mismatch by replacing the two bracketed observations in this prompt:
In index.html, I saw [what happened]. Change it so [what should happen], matching mission.md. Keep every required control and on-screen message unchanged.

What does this prompt do?

The first observation tells Claude which behavior you actually saw. The second observation defines the result that should replace it.

The final sentence protects the fixed controls and required messages while Claude changes only the mismatch.

Claude asks to edit index.html when your mismatch requires a game change.

  • Approve the requested edit to index.html.
  • Review the proposed diff for the reported scene.
  • Use the approval control beside the index.html edit.
  • Reload the game tab after each approved fix.
  • Return to the game tab from earlier.
  • Use the browser's reload control.
  • Replay the corrected scene.

You should see the requested behavior match mission.md while every required control and on-screen message remains available.

✔️ Awesome, I've got everything!

Great. Your saved index.html now contains the complete route, reward animation, and replay control.

ⓧ I'd like to double check the full code

<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>Vibe Coded</title>
<style>
html,body{margin:0;height:100%;background:#10151d;color:#fff;font-family:Arial,sans-serif;overflow:hidden}body{display:grid;place-items:center}canvas{width:min(100vw,960px);height:auto;max-height:100vh;background:#76a86b;box-shadow:0 0 30px #000;outline:none}
</style>
</head>
<body>
<canvas id="game" width="960" height="640" tabindex="0" aria-label="Vibe Coded browser game"></canvas>
<script>
const canvas=document.getElementById("game");
const ctx=canvas.getContext("2d");
const W=canvas.width,H=canvas.height;
const keys=new Set();
const car={x:455,y:555,w:26,h:42,speed:210};
const start={x:455,y:555};
const dinerMarker={x:335,y:180};
const officeMarker={x:625,y:470};
const buildings=[
  {x:70,y:70,w:230,h:160,label:"DINER",color:"#d58a53"},
  {x:660,y:410,w:230,h:160,label:"INVESTORS' OFFICE",color:"#6b78a8"},
  {x:390,y:70,w:180,h:160,label:"CITY BLOCK",color:"#4f8054"},
  {x:70,y:410,w:230,h:160,label:"CITY BLOCK",color:"#4f8054"},
  {x:390,y:410,w:180,h:160,label:"CITY BLOCK",color:"#4f8054"}
];
const dinerLines=[
  ["Co-founder","You made it. We need something investors can see."],
  ["You","I brought a laptop and unreasonable confidence."],
  ["Co-founder","Describe the app and let the AI do the typing."],
  ["You","Then we ship before the coffee gets cold."]
];
const statusLines=[
  "Reading the idea twice for confidence",
  "Spawned 12 subagents to center a div",
  "The co-founder says the coffee is now part of the tech stack.",
  "Testing the button that makes everything happen"
];
const pitch=[
  {q:"What problem does your app solve?",a:["It helps small teams turn rough ideas into clear launch plans.","It adds more meetings to every calendar.","It changes the logo every hour."],correct:0,reason:"The problem was not clear."},
  {q:"How did you build it so quickly?",a:["We skipped every test and hoped.","We used AI, reviewed each result, and tested the full flow.","We bought a mysterious folder online."],correct:1,reason:"The build process did not sound trustworthy."},
  {q:"Why will people keep using it?",a:["It saves time on a task they already repeat.","The button is extremely shiny.","We will remind them every seven minutes."],correct:0,reason:"The answer did not show lasting value."}
];
const dealLines=[
  ["Investor","$10,000,000 for 10%. Do we have a deal?"],
  ["You","Make it a hundred million valuation and you got a deal."],
  ["Investor","Deal!"]
];
let state,objective,lineIndex,pitchIndex,banner,bannerUntil,codingStart,shippedAt,dealIndex,failedReason,passedAt,last=performance.now();
function resetGame(){
  car.x=start.x;car.y=start.y;state="driveDiner";objective="Drive to the diner";
  lineIndex=0;pitchIndex=0;dealIndex=0;banner="";bannerUntil=0;codingStart=0;shippedAt=0;failedReason="";passedAt=0;keys.clear();
}
function rectHit(a,b){return a.x<b.x+b.w&&a.x+a.w>b.x&&a.y<b.y+b.h&&a.y+a.h>b.y}
function blocked(x,y){const box={x,y,w:car.w,h:car.h};return x<0||y<52||x+car.w>W||y+car.h>H||buildings.some(b=>rectHit(box,b))}
function near(marker){return Math.hypot(car.x+car.w/2-marker.x,car.y+car.h/2-marker.y)<34}
function beginDiner(){state="arrivalDiner";banner="Objective complete";bannerUntil=performance.now()+1100;keys.clear()}
function beginOffice(){state="pitch";objective="Pitch the investors";pitchIndex=0;keys.clear()}
function chooseAnswer(index){
  if(state!=="pitch")return;
  if(index===pitch[pitchIndex].correct){
    pitchIndex++;
    if(pitchIndex===pitch.length){state="deal";dealIndex=0}
  }else{
    state="failed";failedReason=pitch[pitchIndex].reason;keys.clear();
  }
}
function retryPitch(){state="pitch";pitchIndex=0;failedReason="";car.x=620;car.y=350;keys.clear()}
window.addEventListener("keydown",event=>{
  const k=event.key.toLowerCase();
  if(["arrowup","arrowdown","arrowleft","arrowright","w","a","s","d"," ","1","2","3","r","enter"].includes(k))event.preventDefault();
  if(state==="dialogue"&&k===" "){
    lineIndex++;
    if(lineIndex>=dinerLines.length){state="coding";codingStart=performance.now()}
    return;
  }
  if(state==="pitch"&&["1","2","3"].includes(k)){chooseAnswer(Number(k)-1);return}
  if(state==="deal"&&k===" "){
    dealIndex++;
    if(dealIndex>=dealLines.length){state="passed";passedAt=performance.now()}
    return;
  }
  if(state==="failed"&&k==="r"){retryPitch();return}
  if(state==="passed"&&k==="enter"){resetGame();return}
  keys.add(k);
});
window.addEventListener("keyup",event=>keys.delete(event.key.toLowerCase()));
function update(now,dt){
  if(state==="driveDiner"||state==="driveOffice"){
    let dx=0,dy=0;
    if(keys.has("arrowleft")||keys.has("a"))dx--;
    if(keys.has("arrowright")||keys.has("d"))dx++;
    if(keys.has("arrowup")||keys.has("w"))dy--;
    if(keys.has("arrowdown")||keys.has("s"))dy++;
    if(dx&&dy){dx*=Math.SQRT1_2;dy*=Math.SQRT1_2}
    const nx=car.x+dx*car.speed*dt,ny=car.y+dy*car.speed*dt;
    if(!blocked(nx,car.y))car.x=nx;
    if(!blocked(car.x,ny))car.y=ny;
    if(state==="driveDiner"&&near(dinerMarker))beginDiner();
    if(state==="driveOffice"&&near(officeMarker))beginOffice();
  }
  if(state==="arrivalDiner"&&now>=bannerUntil){state="dialogue";lineIndex=0}
  if(state==="coding"&&now-codingStart>=8000){state="shipped";shippedAt=now}
  if(state==="shipped"&&now-shippedAt>=1200){state="driveOffice";objective="Drive to the investors' office";car.x=335;car.y=245}
}
function text(value,x,y,size=22,color="#fff",align="left"){
  ctx.fillStyle=color;ctx.font=`bold ${size}px Arial`;ctx.textAlign=align;ctx.fillText(value,x,y);
}
function wrap(value,x,y,maxWidth,lineHeight,size=22,color="#fff"){
  ctx.font=`bold ${size}px Arial`;ctx.fillStyle=color;ctx.textAlign="left";
  const words=value.split(" ");let line="",row=0;
  for(const word of words){const test=line+word+" ";if(ctx.measureText(test).width>maxWidth&&line){ctx.fillText(line,x,y+row*lineHeight);line=word+" ";row++}else line=test}
  ctx.fillText(line,x,y+row*lineHeight);
}
function drawWorld(now){
  ctx.fillStyle="#75a86b";ctx.fillRect(0,0,W,H);
  ctx.fillStyle="#777d84";ctx.fillRect(0,250,W,140);ctx.fillRect(310,0,80,H);ctx.fillRect(580,0,80,H);
  ctx.strokeStyle="#d9d28d";ctx.lineWidth=4;ctx.setLineDash([20,18]);ctx.beginPath();ctx.moveTo(0,320);ctx.lineTo(W,320);ctx.moveTo(350,0);ctx.lineTo(350,H);ctx.moveTo(620,0);ctx.lineTo(620,H);ctx.stroke();ctx.setLineDash([]);
  for(const b of buildings){ctx.fillStyle=b.color;ctx.fillRect(b.x,b.y,b.w,b.h);ctx.strokeStyle="#1b2633";ctx.lineWidth=5;ctx.strokeRect(b.x,b.y,b.w,b.h);text(b.label,b.x+b.w/2,b.y+b.h/2,18,"#fff","center")}
  const marker=state==="driveDiner"?dinerMarker:state==="driveOffice"?officeMarker:null;
  if(marker){const pulse=19+Math.sin(now/180)*5;ctx.strokeStyle="#ffe34d";ctx.lineWidth=7;ctx.beginPath();ctx.arc(marker.x,marker.y,pulse,0,Math.PI*2);ctx.stroke()}
  ctx.save();ctx.translate(car.x+car.w/2,car.y+car.h/2);ctx.fillStyle="#e33d45";ctx.fillRect(-car.w/2,-car.h/2,car.w,car.h);ctx.fillStyle="#bde8ff";ctx.fillRect(-9,-12,18,12);ctx.fillStyle="#171717";ctx.fillRect(-car.w/2-3,-15,5,11);ctx.fillRect(car.w/2-2,-15,5,11);ctx.fillRect(-car.w/2-3,7,5,11);ctx.fillRect(car.w/2-2,7,5,11);ctx.restore();
  ctx.fillStyle="rgba(8,12,18,.88)";ctx.fillRect(0,0,W,52);text(`Objective: ${objective}`,24,34,22);
}
function panel(title,body,hint){
  ctx.fillStyle="rgba(5,8,14,.94)";ctx.fillRect(35,420,890,190);ctx.strokeStyle="#f3cf45";ctx.lineWidth=3;ctx.strokeRect(35,420,890,190);text(title,65,460,24,"#f3cf45");wrap(body,65,500,820,30,22);text(hint,895,585,18,"#c6d2df","right");
}
function drawCoding(now){
  ctx.fillStyle="#091018";ctx.fillRect(0,0,W,H);text("FAKE AI CODE EDITOR",42,55,28,"#7ef0ad");text("> build me a startup. make it viral. no bugs.",42,115,24,"#fff");
  const progress=Math.min(100,Math.floor((now-codingStart)/80));text(`SHIPPED ${progress}%`,42,205,24,"#f3cf45");ctx.fillStyle="#263343";ctx.fillRect(42,230,876,40);ctx.fillStyle="#62d68b";ctx.fillRect(42,230,876*progress/100,40);
  const status=statusLines[Math.min(statusLines.length-1,Math.floor((now-codingStart)/1800)%statusLines.length)];text(status,42,335,22,"#b8c7d9");
}
function drawPitch(){
  ctx.fillStyle="#172033";ctx.fillRect(0,0,W,H);text("INVESTOR PITCH",W/2,70,34,"#f3cf45","center");const p=pitch[pitchIndex];wrap(p.q,90,145,780,34,26);p.a.forEach((answer,i)=>{ctx.fillStyle="#293750";ctx.fillRect(90,235+i*92,780,66);text(`${i+1}. ${answer}`,115,278+i*92,20)});text("Press 1, 2 or 3",W/2,575,20,"#c6d2df","center");
}
function drawDeal(){ctx.fillStyle="#151d2a";ctx.fillRect(0,0,W,H);const d=dealLines[Math.min(dealIndex,dealLines.length-1)];text(d[0],W/2,215,28,"#f3cf45","center");wrap(d[1],150,285,660,42,30);text("Press Space for the next line",W/2,530,20,"#c6d2df","center")}
function drawFailed(){ctx.fillStyle="#2a0e12";ctx.fillRect(0,0,W,H);text("Mission failed",W/2,230,54,"#ff5964","center");wrap(failedReason,190,300,580,35,24);text("Press R to retry",W/2,430,24,"#fff","center")}
function drawPassed(now){ctx.fillStyle="#10151d";ctx.fillRect(0,0,W,H);text("Mission passed!",W/2,200,64,"#ffd83d","center");const amount=Math.min(10000000,Math.floor(((now-passedAt)/3000)*10000000));text(`$${amount.toLocaleString("en-US")}`,W/2,300,44,"#fff","center");text("You raised a $10M seed round for your vibe coded startup.",W/2,380,24,"#c9d5e2","center");if(now-passedAt>=3000)text("Press Enter to play again",W/2,500,22,"#fff","center")}
function render(now){
  if(["driveDiner","arrivalDiner","dialogue","driveOffice"].includes(state)){drawWorld(now);if(state==="arrivalDiner")text(banner,W/2,330,42,"#ffd83d","center");if(state==="dialogue"){const d=dinerLines[lineIndex];panel(d[0],d[1],"Space: next line")}}
  else if(state==="coding")drawCoding(now);
  else if(state==="shipped"){drawCoding(codingStart+8000);text("Shipped!",W/2,470,58,"#ffd83d","center")}
  else if(state==="pitch")drawPitch();
  else if(state==="deal")drawDeal();
  else if(state==="failed")drawFailed();
  else if(state==="passed")drawPassed(now);
}
function loop(now){const dt=Math.min(.033,(now-last)/1000);last=now;update(now,dt);render(now);requestAnimationFrame(loop)}
resetGame();requestAnimationFrame(loop);
</script>
</body>
</html>
3. Record the complete mission

The mission recording turns your successful playtest into a shareable result. It should preserve the full route from the first objective through the completed reward count.

macOS

  • Capture the complete mission recording on macOS with Screenshot.
  • Press Cmd+Shift+5.
  • Select Record Entire Screen or Record Selected Portion.
  • Click Record.
  • Play the mission from the first objective through the completed reward counter.
  • Click Stop in the menu bar after the counter reaches $10,000,000.

You should see a saved video containing the complete playthrough.

Windows

Xbox Game Bar

  • Capture the complete mission recording on Windows with Xbox Game Bar.
  • Press Win+Alt+R to start recording.
  • Play the mission from the first objective through the completed reward counter.
  • Press Win+Alt+R to stop recording after the counter reaches $10,000,000.

You should see a saved video containing the complete playthrough.

Snipping Tool

  • Capture the complete mission recording on Windows with Snipping Tool.
  • Select Record.
  • Select New.
  • Select the game area.
  • Select Start.
  • Play the mission from the first objective through the completed reward counter.
  • Select Stop after the counter reaches $10,000,000.

You should see a saved video containing the complete playthrough.

  • Move the saved video into my-mission with your computer's file manager.
  • Locate the newest recording in your computer's file manager.
  • Drag the video into my-mission.

The my-mission folder should now contain mission.md, index.html, and the mission recording.

Before you review the video, predict whether it captured both the opening objective and the complete reward count.

  • Play the mission recording from my-mission.
  • Select the saved mission recording in your computer's file manager.
  • Open the video with your computer's playback control.

You should see the route begin at the first objective and continue through the diner, coding sequence, investor pitch, and Deal!.

The recording should finish with Mission passed! and the counter reaching $10,000,000. That is the complete mission captured from start to finish.

Secret mission

Add a Timed Second Mission and Jingle

Add a countdown-driven second mission with three ordered stops. Complete the route to hear a generated jingle, then test the timeout and retry path.

Clean Up Your Resources

Clean Up Your Resources

Choose whether to keep the game ready, close it until later, or remove it from your computer. The local files create no ongoing cost.

Resources you used:

  • A Claude Code installation with a Manual-mode project session running inside my-mission.
  • A game tab loaded from index.html.
  • A local project folder named my-mission containing mission.md, index.html, and the mission recording.

Keep everything running

Everything can stay in place while you keep building or replaying the missions. Future project-session activity continues to use the limits from your existing Claude plan.

  • Leave the project session running in Manual mode.
  • Keep the game tab loaded from index.html.
  • Keep my-mission with mission.md, index.html, and the mission recording together.
  • Leave Claude Code installed for future projects.

Pause - I'll come back to this later

Pausing closes the active windows while preserving your game. Claude Code remains installed for your return.

  • End the project session in its Terminal or Windows PowerShell window.
  • Close the game tab.
  • Leave my-mission in its current location.
  • Return to my-mission in Terminal or Windows PowerShell when you are ready to continue.
  • Restart the project session from my-mission by running this command:
claude

What does this command do?

The claude command starts a project session in the folder your command line currently uses. Running it from my-mission gives Claude access to the game files again.

Delete - I don't want to use this again

Deleting my-mission is permanent. Its mission.md, index.html, and mission recording disappear with it.

  • Move the mission recording outside my-mission first if you want to keep it.
  • End the project session in its Terminal or Windows PowerShell window.
  • Close the game tab.

macOS

  • Press Cmd+Space to open Spotlight.
  • Type Finder.
  • Press Return to open Finder.
  • Locate my-mission at the location where you created it.
  • Drag my-mission to the Trash.
  • Empty the Trash to remove the folder permanently.

You should no longer see my-mission in Finder, which confirms the project folder was removed.

Windows

  • Press the Windows key to open search.
  • Type File Explorer.
  • Press Enter to open File Explorer.
  • Locate my-mission at the location where you created it.
  • Move my-mission to the Recycle Bin.
  • Empty the Recycle Bin to remove the folder permanently.

You should no longer see my-mission in File Explorer, which confirms the project folder was removed.

The project folder is gone. Your Claude Code installation remains available unless you complete the optional uninstall.

Nice Work!

Nice Work!

You did it! You directed Claude Code to build an original HTML Canvas browser game with plain JavaScript.

You've learned how to:

  • Turn a mission plan in mission.md into a playable one-file browser game in index.html.
  • Playtest game states from driving through replay. Confirm Mission failed and Mission passed! as separate outcomes.
  • Request plain-English fixes from Claude Code without editing the code yourself. Save a mission recording of the complete first mission.
  • Secret Mission: Add a timed three-stop follow-up mission. Generate its completion jingle with the Web Audio API.

Ready to quiz yourself?