Scratch Platformer Tutorial Step-by-Step (Beginner Friendly)

Michael Murr··9 min read

A Scratch platformer is a classic side-view game where a character runs, jumps, and lands on platforms. It is one of the most satisfying first big projects in Scratch, because the result is a complete, playable game that the child built themselves. This tutorial walks through eight specific steps to build a working platformer from scratch (no pun intended), with the actual blocks to use, what each one does, and what to try next once it works.

Key Takeaways

  • A Scratch platformer teaches movement, gravity, jumping, collision detection, and game design, all in one project.
  • Most children aged 9 to 12 with some prior Scratch experience can build a working platformer in 4 to 6 sessions of focused work.
  • The platformer pattern is foundational. Once a child understands how this works, they can build dozens of variations.
  • The most common stumbling block is gravity. The fix is straightforward but takes most beginners 1 to 2 attempts to get right.
  • Scratch is free, runs in any browser, and saves projects automatically when you sign in.

Table of Contents

Before You Start

Open Scratch at scratch.mit.edu and click "Create" to start a new project. Sign in if you want the project saved automatically. The interface has three main areas: the Stage (top right, where the game runs), the Sprite list (bottom right, where your characters live), and the Code area (centre, where you build the program by snapping blocks together).

Delete the default cat sprite if you do not want it. Use the Sprite icon (bottom right corner) to choose a new sprite, draw your own, or upload one. For this tutorial, any single small sprite will work as the player.

Step 1: Set Up the Stage and Player

First, create the basic scene:

  • Click the Backdrop icon (bottom right) and choose a backdrop, "Blue Sky" or "Hills" work well for a platformer
  • Make sure your player sprite is selected in the Sprite list

In the Code area, drag these blocks together:

when [flag] clicked
go to x: -200 y: -100

What this does: When the green flag is clicked, the player sprite moves to the bottom-left of the stage. This is your starting position.

Click the green flag to test. Your player should appear in the bottom-left corner.

Step 2: Add Left and Right Movement

Now make the player move with arrow keys. Add these blocks to your existing code:

when [flag] clicked
go to x: -200 y: -100
forever
  if <key [right arrow] pressed?> then
    change x by 5
  end
  if <key [left arrow] pressed?> then
    change x by -5
  end
end

What this does: The forever loop runs continuously, checking each frame whether the right or left arrow is pressed. If right is pressed, the sprite moves 5 pixels to the right. If left is pressed, 5 pixels to the left.

Click the green flag and try the arrow keys. The player should move smoothly left and right.

Step 3: Add Gravity

Real platformers need gravity. The player should fall when they are not standing on something. Add a variable to track vertical speed:

  • Click Variables (orange) in the block palette
  • Click Make a Variable, name it y velocity, click OK
  • Uncheck the box next to y velocity so it does not show on screen

Now modify your code to handle gravity:

when [flag] clicked
go to x: -200 y: -100
set [y velocity] to (0)
forever
  change [y velocity] by (-1)
  change y by (y velocity)
  if <key [right arrow] pressed?> then
    change x by 5
  end
  if <key [left arrow] pressed?> then
    change x by -5
  end
end

What this does: y velocity starts at 0. Each frame, gravity pulls it down by 1, so the player accelerates downward. The player's y position changes by the current velocity each frame.

Click the green flag. The player should fall off the bottom of the screen. That is gravity working, but you have not yet given them anything to land on.

Step 4: Add the Ground (First Collision)

To stop the player falling forever, you need ground. Create a new sprite called "Ground":

  • Click the Sprite icon → Paint
  • Draw a long, thin rectangle (use the Rectangle tool)
  • Position it across the bottom of the stage

Now make the player stop when they touch the ground. Modify your forever loop:

forever
  change [y velocity] by (-1)
  change y by (y velocity)
  if <touching [Ground]?> then
    change y by (1)
    repeat until <not <touching [Ground]?>>
      change y by (1)
    end
    set [y velocity] to (0)
  end
  if <key [right arrow] pressed?> then
    change x by 5
  end
  if <key [left arrow] pressed?> then
    change x by -5
  end
end

What this does: When the player touches the ground, the code pushes them up one pixel at a time until they are no longer touching, then resets their vertical velocity to 0 (so they stop falling).

Click the green flag. The player should now fall and land on the ground, then sit there until you press an arrow key.

Step 5: Add Jumping

Add jumping to the same forever loop. The trick: the player can only jump when they are touching the ground, otherwise they could double-jump infinitely.

forever
  change [y velocity] by (-1)
  change y by (y velocity)
  if <touching [Ground]?> then
    change y by (1)
    repeat until <not <touching [Ground]?>>
      change y by (1)
    end
    set [y velocity] to (0)
    if <key [up arrow] pressed?> then
      set [y velocity] to (12)
    end
  end
  if <key [right arrow] pressed?> then
    change x by 5
  end
  if <key [left arrow] pressed?> then
    change x by -5
  end
end

What this does: After the player lands and the velocity is reset to 0, the code checks if the up arrow is pressed. If so, it sets the velocity to 12 (a sudden upward push). Gravity then pulls the player back down naturally.

Click the green flag and try jumping. The player should now jump in a smooth arc and land back on the ground.

Step 6: Add Platforms

Now make jumping useful. Create more platforms:

  • Right-click the Ground sprite, choose Duplicate
  • Move the new platform up and to the right
  • Repeat for as many platforms as you want

Important: in your player's code, change touching [Ground]? to touching colour [colour of your platforms]?. To do this, click the colour swatch in the touching colour block, then click the eyedropper icon and click on a platform.

This way, the player lands on any object of that colour, not just the original Ground sprite.

if <touching colour [#5B5B5B]?> then  // your platform colour

Click the green flag and jump between platforms. You should be able to jump up and reach platforms above the starting position.

Step 7: Add a Goal

A platformer needs an ending. Add a goal sprite the player must reach:

  • Add a new sprite (a star, a flag, or anything)
  • Position it somewhere reachable but not trivial

In the player's code, add this block at the bottom of the forever loop, just before the end:

if <touching [Goal]?> then
  say [You won!] for (3) seconds
  stop [all]
end

What this does: When the player touches the goal, the game says "You won!" and stops everything.

Click the green flag, navigate to the goal, and confirm the win condition works.

Step 8: Polish

The basic game works. Now make it feel better:

Add a death zone. If the player falls below the stage, restart their position:

if <(y position) < (-179)> then
  go to x: -200 y: -100
  set [y velocity] to (0)
end

Add walking animation. If your sprite has multiple costumes, switch between them when the player is moving:

if <key [right arrow] pressed?> then
  change x by 5
  next costume
end

Add jumping sound. Click Sounds at the top of the Code area, choose a "Boing" or similar sound, then in your code, when you start a jump:

if <key [up arrow] pressed?> then
  set [y velocity] to (12)
  start sound [Boing]
end

Add a score. Make a score variable, and increase it when the player collects items (add coin sprites that disappear when touched).

Each polish step takes 5 to 15 minutes and makes the game noticeably more satisfying. The polish is what turns "I built a platformer" into "I built a game I want to show people."

What to Build Next

Once your basic platformer works, the natural next projects are:

A multi-level platformer. Use multiple backdrops (one per level). When the player reaches a goal, switch to the next backdrop and reposition platforms.

Enemies. Add sprites that move automatically. If the player touches one, they restart. This introduces obstacle logic and makes the game harder.

Power-ups. Add items that change the player's abilities temporarily (faster movement, higher jumps, ability to fly).

Time challenge. Add a timer that counts up. Players try to finish faster on each attempt.

For more project ideas at this level, see our best coding projects for kids age 8 to 10 and our summer coding at home: 30 project ideas guides.

FAQ

What age can kids build a Scratch platformer?

Most children aged 9 to 12 with some prior Scratch experience can build a working platformer over 4 to 6 sessions. Children younger than 9 sometimes struggle with the gravity and collision logic, which involves more abstract thinking than simpler Scratch projects. A child completely new to Scratch should typically build 3 to 4 simpler projects (Catch game, Maze, Quiz) before attempting a platformer.

How long does it take to make a platformer in Scratch?

A basic working platformer takes most children 4 to 6 hours of focused work, typically spread across 4 to 6 sessions. Adding polish (animations, sounds, multiple levels, enemies) can extend this to 10 to 15 hours. The result is a substantial project the child can be genuinely proud of and share.

Why does my Scratch platformer character glitch through the ground?

The most common cause is the gravity step being too large. If y velocity reaches values larger than 10 to 15, the player can move past the ground in a single frame before the collision check runs. Either reduce gravity (change by smaller amounts) or split the movement into smaller steps that check collision more frequently.

How do I make the camera follow the player in Scratch?

Scratch does not have a true camera, but you can simulate one by moving all the platforms and obstacles instead of moving the player horizontally. Keep the player's x position fixed, and when the player presses right, move all the other sprites left instead. This is more advanced than a basic platformer but is a logical next step.

Can a Scratch platformer be turned into a real published game?

Scratch platformers can be shared on the Scratch website (scratch.mit.edu) where other children play and remix them. To publish a "real" game on app stores or game platforms, the child eventually needs to learn a more powerful tool, typically Python with Pygame or another game engine. Scratch is genuinely valuable as a starting point but has clear limits at the publishing stage.

What if my child can't get the platformer working?

If your child is consistently stuck on this project, the foundation might be the issue rather than the project. Most platformer struggles come from missing concepts (variables, conditionals, sequencing) that are easier to master through smaller projects first. See our signs your child is ready for coding lessons and when coding makes kids upset guides for what to do.


Want a tutor's help guiding your child through their first Scratch platformer? Book a free Discovery Call, 20 minutes, no obligation, and you'll leave with a clear plan for what to build next.

Enjoyed this article?

Your child can learn this and more with a dedicated 1-on-1 tutor.

Book a Free Discovery Call