Arcade LabXP 0

World 1 / Quest 02

Dodge!

Things fall. This time you get OUT of the way.

About 45 minutes+100 XP

You’ll build: A dodging game with 3 lives, a game-over screen, and a restart — built one piece at a time.

Power-up: One Thing at a TimeBadge: Write the Rules

You’ll learn

Briefing

You turn Catch! into Dodge!: rocks instead of apples, three lives, a game-over screen, and a restart. This quest trains Power-Up 2: One Thing at a Time and earns the Write the Rules badge.

Start prompt

Say this to Coach

/arcade-lab Start Quest 2: Dodge! Make me a fresh game folder called dodge, starting from my Catch! game, and open the coach notes.

Steps

  1. 1

    Flip it: catching becomes dodging

    One prompt, and it's a different game. Right now, touching an apple gives a point. Make touching a rock take away a life. That's it. Nothing else yet.

    Then refresh and play it. You just turned Catch! into Dodge! with one sentence.

    Say this to Coach

    First job, and only this job: change the falling apples into rocks. When a rock touches the player, the player loses 1 life instead of getting a point. Don't add a game over yet. I'll test it.

  2. 2

    Now write the rules

    You've felt the game. Now decide what it is, before Coach builds another thing. Tell Coach the rules of Dodge! in your own words. Decide these three first:

    • Lose: "You lose when ______" (example: when a rock hits you 3 times)
    • Score: "You get points for ______" (example: every second you survive)
    • Win: "There's no winning — you try to beat your best score" — or pick something else!

    Game makers decide this. Not the computer. Pick yours, then change the line below to match.

    Say this to Coach

    Here are the rules for Dodge! You lose when a rock hits you 3 times. You get points for every second you survive. The goal is to beat your best score. Please write these rules down at the top of the code as a comment.

  3. 3

    Show the lives

    Tell Coach how the flip went, then ask for the next single thing: show the lives on screen as hearts. Look at the two prompts:

    First try: add lives and a game over screen and a restart button and make the rocks bounce and add a score

    Better: Next job: show the player's lives in the top-left corner as 3 red hearts. When a life is lost, one heart goes gray. Only that.

    Say this to Coach

    I tested it: rocks take a life now and it works. Next job: show the player's lives in the top-left corner as 3 red hearts. When a life is lost, one heart goes gray. Only that for now.

  4. 4

    Game over (one thing)

    Now the game-over screen. Say what it should look like: what words show up, what color, and whether the rocks keep falling behind it or freeze.

    Say this to Coach

    Next job: when lives hit 0, freeze everything and show a big GAME OVER in the middle with my score under it. Don't add a restart yet.

  5. 5

    Restart (one thing)

    Last piece: a way to play again. Pick one — press SPACE, or click a button — and say exactly which.

    Say this to Coach

    Last job: on the game over screen, show 'Press SPACE to play again.' When I press SPACE, everything resets: 3 lives, score 0, rocks start over.

  6. 6

    Score the way YOU decided

    Go back to your rules from step 2. Does the score work the way you wrote it? If not, that's the next single job. Give Coach the full picture: what it does now, what your rule says, and how you'll test it.

    Say this to Coach

    My score rule says I get a point every second I survive. Right now the score never changes. Make it match my rule. I'll know it worked when the number climbs while I dodge.

Side quests +10 XP each

0 of 3 done

Stuck?

More ways to get unstuck

Ship checklist

0 of 4 done

Bonus round

Show Dad

Show Dad the game over screen, then restart it. Dad's question: "What are the rules of this game — how do you lose, and what's the score for?" Say them without looking at the screen.