Ages 10–12
Write your own functions, model characters with objects, and build the logic behind real games.
Write Your Own Command
So far you've used commands somebody else wrote. Now you write your own. A function bundles several lines under one name so you can reuse them forever.
Badge: 🏅 Function Author
Parameters Make Functions Flexible
A function with no inputs always does exactly the same thing. Parameters turn one function into hundreds of possibilities.
Badge: 🏅 Parameter Pro
Functions That Give Answers
Some functions do things; others work something out and hand the answer back with return. Build a function that calculates how far a racer travels.
Badge: 🏅 Return Ranger
Objects: Bundle the Facts
A game character has a name, a speed, and a score. Keeping three separate variables gets messy fast — an object keeps related facts together.
Badge: 🏅 Object Architect
A Whole Team of Characters
One object is a character. An array of objects is a team, a level, or an enemy wave — the backbone of nearly every game.
Badge: 🏅 Team Coder
Short Functions: Arrows
Professional JavaScript is full of little arrow functions — a shorter way to write the same thing, especially when passing a function to another function.
Badge: 🏅 Arrow Coder
Game Logic: Keeping Score
Every game needs a score. Collect coins, add points, and check whether the player beat the target — that's game logic.
Badge: 🏅 Score Keeper
Collisions: Did They Touch?
Games need to know when two things bump into each other. The trick is comparing positions — if they're close enough, that's a hit.
Badge: 🏅 Collision Coder
States: Idle, Running, Sleeping
Game characters live in states. A pet might be idle, then running, then sleeping — and the state decides what it does next.
Badge: 🏅 State Machine
Build a Reusable Scene
Good programmers don't repeat themselves. Write one function that builds an entire scene, then call it with different inputs to make different worlds.
Badge: 🏅 Scene Composer
Algorithms: Find the Winner
Given a list of scores, how does a computer find the biggest? It checks them one at a time and remembers the best so far. That's an algorithm.
Badge: 🏅 Algorithm Ace
Project: Jungle Coin Run
Your final challenge: a mini game. A monkey runs through the jungle, collects coins, dodges rocks, and ends with a win or a crash — all from your code.
Badge: 🏅 Game Maker