Back to Game Builder
Code Studio · Level 9

Game Engine Challenge 🏆

Build your own tiny game from scratch: a class that tracks a score, stores items, and prints a final status. Run it and watch your whole game play out.

10-15 min Ages 9-12 Challenge JavaScript
Code Editor

Build your own game state.

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

  earn(item, points) {
    this.items.push(item);
    this.score += points;
  }

  finish() {
    say(this.title + " complete!");
    say("Score: " + this.score);
    say("Items: " + this.items.join(" + "));
  }
}

let game = new Game("Star Rescue");
game.earn("star", 10);
game.earn("key", 5);
game.finish();
🧩 Tap to add code blocks — design a game, earn points, finish it
🎯 Earn at least one item and call finish() to win. star key rocket
Game Screen

Your game, running live

GAME SCORE 0

Run your code to start the game…

ITEMS

Waiting for your game…