Back to Debug Challenge
Code Studio · Level 12

Capstone Mini Game

The final boss. Combine everything — variables, loops, conditionals, functions, and classes — into one tiny playable game. You have the whole toolkit now.

15-20 min Ages 9-12 Real Code JavaScript
Code Editor

Plan the final game.

Example code
class MiniGame {
  constructor(title) {
    this.title = title;
    this.score = 0;
    this.items = [];
  }

  collect(item, points) {
    this.items.push(item);
    this.score += points;
    say("Collected " + item);
  }

  finish() {
    if (this.items.includes("star") && this.score >= 10) {
      say(this.title + " complete!");
    } else {
      say("Keep building your game.");
    }
  }
}

let game = new MiniGame("Robot Star Quest");
game.collect("star", 10);
game.finish();
Output

Program result

Robot ready to speak your strings

Type real JavaScript, then run it.