Skip to content
ExploreMapGamesStoriesComicsVideosStudioPrintablesCode LabJourneys
By age โ–พ
  • ๐Ÿงธ Tiny Explorers2โ€“5
  • ๐Ÿฆ‰ Curious Learners6โ€“8
  • ๐Ÿ”ญ Young Investigators9โ€“12
  • ๐Ÿš€ Trailblazers13โ€“17
๐Ÿ‘คParent sign in
Kids Amazing World

A creative learning playground. No ads, no tracking, no chat. Every item is reviewed before it appears.

Explore

  • Explore
  • Learning journeys
  • Surprise me
  • Parent planner

For grown-ups

  • Child safety
  • Privacy
  • Terms (draft)
  • Free & Premium
  • Parent sign in

About this content

Some items in this build are placeholders written for development. Third-party resources are only listed with permission, a license, or an official embed.

โ† All game tutorials

๐Ÿ„ Platformer

Run, jump, stomp the baddies, and design your own level.

How to playYour functionsSettings you can changeStep by stepIdeas to tryLessons

๐ŸŽฎ How to play

Reach the flag ๐Ÿ (or the goal score) without running out of lives. Collect coins, jump over gaps, and stomp enemies by landing on top of them.

  • โ—€ โ–ถ buttons or โ† โ†’ (hold): Run.
  • Jump button, โ†‘ or the space bar: Jump. Only works when you are standing on something.

The map letters

.
empty air
#
a solid block (ground, walls, platforms)
o
a coin
e
an enemy that patrols back and forth
F
the flag: reach it to win
@
where you start (optional)

โš™๏ธ Your functions

You write these functions. The game calls them when something happens.

  • onCoin()

    Runs every time you pick up a coin.

    function onCoin() {
      score = score + 1;
    }
  • onStomp()

    Runs when you land on top of an enemy.

    function onStomp() {
      score = score + 5;
    }
  • onHit()

    Runs when an enemy touches you from the side, or you fall into a pit. You respawn at the start with a moment of safety.

    function onHit() {
      lives = lives - 1;
    }
  • onFlag() optional

    Runs when you reach the flag, just before you win.

    function onFlag() {
      score = score + 100;
    }

๐ŸŽš๏ธ Settings you can change

Variables at the top of your code are the game's settings. Change a value, press Play, and see what happens.

player = "๐Ÿง‘"
The emoji for you.
enemy = "๐Ÿ‘พ"
The emoji for the enemies.
goal = 9999
Reach this score to win (the flag also wins).
lives = 3
Hits you are allowed.
jumpPower = 2
From 1 to 4: how high you jump. 2 clears a 2-block wall; 3 jumps much higher.
level = the map
The map: a list of text rows (see the legend). optional
block = "๐Ÿงฑ"
The emoji for solid blocks. optional
coin = "๐Ÿช™"
The emoji for coins. optional
flag = "๐Ÿ"
The emoji for the flag. optional
score = 0
Your points. The game starts it at 0 and you change it in your functions. set by the game

๐Ÿชœ Step by step

Each step shows code you can add to the end of your game's code. A function or variable written later replaces the earlier one, so you never have to delete anything.

  1. 1Play the starter

    Run to the right, jump the walls and gaps, and reach the flag. The level is just a list of text rows near the bottom of the code.

    function onCoin() {
      score = score + 1;
    }
  2. 2Jump higher

    jumpPower changes the whole feel of the game.

    let jumpPower = 3;
  3. 3Stomps make you jump higher

    The game reads jumpPower every moment, so you can change it while you play. Here every stomp makes your jump a little higher (up to 4).

    function onStomp() {
      score = score + 3;
      jumpPower = Math.min(4, jumpPower + 1);
    }
  4. 4Design your own level

    Replace the level with your own. Every row must be the same length (at least 8 characters, up to 60) with 4 to 14 rows. Put solid ground (#) under the flag. Keep gaps 3 wide or less and walls 2 tall or less so it's fair.

    let level = [
      "............",
      "............",
      "....ooo.....",
      "@.......e..F",
      "############",
    ];
Show the full starter code
// ๐Ÿ„ Platformer!
let player = "๐Ÿง‘";
let enemy = "๐Ÿ‘พ";
let goal = 9999;        // reach this score to win (or just reach the flag!)
let lives = 3;
let jumpPower = 2;   // 1 to 4: how high you jump

// The map. Each row is a piece of text:
//   .  empty air     #  a solid block     o  a coin
//   e  an enemy      F  the flag (reach it to win)     @  where you start
let level = [
  "....................................",
  "....................................",
  "....................................",
  ".........ooo..............ooo.......",
  "....................................",
  "....................................",
  "@....o......#......e....#...o...e..F",
  "#################..##########..#####",
];

function onCoin() {
  score = score + 1;
}

function onStomp() {
  score = score + 5;
}

function onHit() {
  lives = lives - 1;
}

๐Ÿ’ก Ideas to try

  • A cave level full of coins with no enemies.
  • A tricky level with lots of gaps and a long run.
  • Give a 100 point bonus for reaching the flag using onFlag.
  • Make the flag a ๐Ÿ† and the enemies ๐Ÿ‘ป.

Tips

  • The Game Studio can playtest your level for you: in the lesson, a robot tries to finish it.
  • Press the jump button just before the edge of a gap, not after!

๐ŸŽ“ Lessons for this game

  • ๐Ÿ”’Platformer: run and jumpPremium
  • ๐Ÿ”’Platformer: stomp and bouncePremium
  • ๐Ÿ”’Platformer: design a levelPremium

๐Ÿ› ๏ธ Make your own Platformer game

Game Studio and the full lessons are part of Premium.

See Premium
โ† ๐Ÿงฑ Tetris๐ŸŽ๏ธ Racing โ†’