How to Make a 3-Level Platformer Game in Scratch | Mario-Style Hen Adventure Game

How to Make a 3-Level Platformer Game in Scratch Mario-Style Hen Adventure Game

Introduction – Platformer Game in Scratch

Have you ever wanted to build your own Mario-style platformer game in Scratch? This step-by-step guide will walk you through how to make a 3-level platformer game in Scratch — featuring a jumping hen, coins (eggs) for scoring, water hazards, and lives.

This tutorial is perfect for beginners learning Scratch programming, game animation, and interactive storytelling. Inspired by the video tutorial from Kodex Academy, we’ll turn a simple animation into a complete playable game.

By the end of this guide, you’ll master:

  • How to design multiple levels in Scratch
  • How to code jump, gravity, and movement physics
  • How to implement score and life tracking
  • How to make level transitions and win/lose conditions
  • How to enhance your game with sound effects and animations

What You’ll Need

Before starting, head to Scratch and open a new project.

You’ll use the Scratch editor to:

  • Add sprites (like the Hen and Egg)
  • Create levels using custom-painted backdrops
  • Code game logic using Scratch’s visual programming blocks

Scratch Coding for 3-Level Platformer Game

Step 1: Setting Up the Game Characters

Delete the Default Cat Sprite

  • Click on the cat sprite and delete it.

Add a Hen Sprite

  • Click Choose a Sprite → Search “Hen”.
  • Resize it to 50% so it fits the level layout.
  • Keep only two costumes for smoother animation (delete costume 3 and 4).

Create the Level Sprite

  • Click Paint → Draw rectangles to form platforms.
  • Choose brown for land, and blue for water.
  • Name the sprite “Level” and create 3 costumes:
    • Costume 1: Level 1
    • Costume 2: Level 2
    • Costume 3: Level 3

Step 2: Coding the Hen’s Jump and Gravity

Create smooth up-down movement using a custom block.

Create a Custom Block

My Blocks → Make a Block → Name it “Up Down Movement”
Add two inputs:

  • jump height
  • fall speed
    ✅ Check Run Without Screen Refresh

Variables Required

  • Y velocity (for vertical movement)

Code for Jump & Gravity

when green flag clicked
set size to 50
set [Y velocity v] to 0
forever
  Up Down Movement (15) (-1)
end

Define Up Down Movement (jump height) (fall speed)

change y by (Y velocity)
if <touching [level v]?> then
  set [Y velocity v] to (0)
else
  change [Y velocity v] by (fall speed)
end
if <key [up arrow v] pressed?> then
  set [Y velocity v] to (jump height)
end

Now the hen jumps when the up arrow is pressed and falls back smoothly.

Step 3: Coding Left and Right Movement

Create Another Custom Block

My Blocks → Make a Block → “Left Right Movement”
Add inputs:

  • move speed
  • drag

Variables

  • X velocity

Code for Horizontal Movement

  • define Left Right Movement (move speed) (drag)
if <key [right arrow v] pressed?> then
  set [X velocity v] to (move speed)
  point in direction (90)
else
  if <key [left arrow v] pressed?> then
    set [X velocity v] to ((move speed) * (-1))
    point in direction (-90)
  else
    set [X velocity v] to ((X velocity) * (drag))
  end
end
change x by (X velocity)

Add this inside the forever loop with the Up Down Movement block.

Step 4: Switching Between Levels

When the hen reaches the end of the screen, it should move to the next level.

Code for Level Transition

if <(x position) > [235]> then
  broadcast [next level v]
end

In the Level Sprite:

when I receive [next level v]
change [level v] by (1)
next costume

This code switches to the next level background and increases the level counter.

Step 5: Detecting Water and Falling Off

If the hen touches water or falls below the stage, it should lose a life.

Code for Water & Fall Detection

# define Check Touching Water
if <touching color [#3399FF]> then
  change [lives v] by (-1)
  go to x: (-203) y: (-71)
end

# define Check Fall Off Screen
if <(y position) < [-170]> then
  change [lives v] by (-1)
  go to x: (-203) y: (-71)
end

Step 6: Adding the Egg and Scoring System

Add an Egg sprite for scoring.

Egg Setup

when green flag clicked
go to x: (100) y: (50)
switch costume to [egg1 v]

In Hen Sprite:

if <touching [egg v]?> then
  broadcast [egg hatch v]
end

In Egg Sprite:

when I receive [egg hatch v]
switch costume to [egg2 v]
change [score v] by (1)
play sound [coin v]
wait (0.5) seconds

Step 7: Adding Win and Game Over Conditions

Variables

  • score
  • lives (set to 3 initially)

Code in Hen Sprite

when green flag clicked
set [score v] to (0)
set [lives v] to (3)
if <(score) = [10]> then
  broadcast [you win v]
end

if <(lives) = [0]> then
  broadcast [game over v]
end

Backdrop Code

when I receive [you win v]
switch backdrop to [You Win v]

when I receive [game over v]
switch backdrop to [Game Over v]

Step 8: Add Sound Effects and Animation

Enhance player engagement by adding:

  • Jump Sound: when the up arrow is pressed
  • Coin Sound: when the egg hatches
  • Background Music: looped sound in the stage

You can find free sounds at Freesound.org or within the Scratch sound library.

Final Gameplay

Now test your game!

  • Jump with Up Arrow
  • Move with Left/Right Arrows
  • Collect Eggs for score
  • Avoid Water or falling off the screen
  • Win when score = 10
  • Lose when lives = 0

🎥 Watch the original video tutorial for visual guidance: How to Make a 3-Level Platformer Game in Scratch | Mario-Style Hen Adventure Game – by Kodex Academy

Enhancement Ideas

Take your game to the next level! Try adding:

1. Power-ups

Add a new sprite like a “star” that gives temporary invincibility.

when green flag clicked
forever
  if <touching [star v]?> then
    set [invincible v] to [true]
    wait (5) seconds
    set [invincible v] to [false]
  end
end

2. Enemy Sprites

Create a walking enemy and code collision detection to decrease lives.

3. Background Music & Level Transitions

Use different backdrop music for each level using the “play sound until done” block.

4. Double Jump Feature

Add an advanced jump mechanic:

# define Double Jump
if <key [up arrow v] pressed?> then
  if <(jump count) < [2]> then
    change [Y velocity v] by (15)
    change [jump count v] by (1)
  end
end
if <touching [level v]?> then
  set [jump count v] to (0)
end

Conclusion: Mario-Style Hen Adventure Game

Congratulations! You’ve successfully created your very own 3-Level Platformer Game in Scratch — complete with jumping mechanics, multiple levels, scoring, lives, and water hazards. This project not only helps you understand how to make a platformer game in Scratch, but also teaches essential concepts of game physics, event handling, and character animation that form the foundation of game development.

From a simple idea inspired by classic Mario games, you’ve built an engaging adventure featuring a lively hen that runs, jumps, and collects eggs across colorful levels. With just a few creative touches and Scratch coding blocks, you turned animation into an interactive gaming experience!

But don’t stop here — Scratch allows endless creativity! Try adding new levels, power-ups, moving enemies, background music, or even a double jump feature to make your game more dynamic and fun.

Call to Action

  1. Don’t forget to check out the full video tutorial: How to Make a 3-Level Platformer Game in Scratch | Mario-Style Hen Adventure Game – by Kodex Academy
  2. Like, comment & share the video
  3. Visit kodexacademy.com
  4. subscribe to the Kodex Academy YouTube channel for deeper Scratch content.

Happy coding with Kodex Academy! 🚀

Learn More with Kodex Academy

At Kodex Academy, we’re passionate about helping students learn coding in creative ways. This project teaches more than Scratch—it empowers young minds to build tools that work in the real world.

Explore more:

Stay updated with new content, free tutorials, and coding challenges!

Further Reading & Links

Recent Posts

How to Make a Health Bar Animation in Scratch | Healthy vs Junk Food Game Tutorial (Full Step-by-Step Guide)

How to Make a Health Bar in Scratch | Healthy vs Junk Food Game | Scratch Animation | Kodex Academy Creating fun and engaging games in Scratch not only helps kids learn coding, but also encourages...

How to Make a Basketball Game in Scratch | Full Tutorial (Moving Hoop + Jumping Ball + Score)

Are you ready to create an exciting basketball game in Scratch with a moving hoop, jumping player, and real-time scoring? This step-by-step Scratch game tutorial is perfect for beginners who want to...

How to Make 3D Shapes in Scratch – Draw Cubes, Pyramids & Cylinders Using Pen Extension

If you’ve ever wondered how to make 3D shapes in Scratch or create 3D geometry using code, you’re about to dive into a creative world of math, animation, and programming fun. Learn how to make...

How to Make Flappy Bird Game in Scratch | Coin Collection Game in Scratch | Scratch Coding for Beginners

Have you ever wondered how people create fun games like Flappy Bird without writing a single line of code? With Scratch programming, anyone — from complete beginners to young creators — can build...

How to Make Day & Night Animation in Scratch (Step-By-Step Full Tutorial)

If you’ve ever wondered how to make day and night animation in Scratch or wanted to bring your stories and games to life with realistic sky transitions, this tutorial is perfect for you! Scratch is...

How to Make a Shooting Game in Scratch | Jet Shooting Game Tutorial (Step-By-Step Guide)

Introduction - Jet Shooting Game in Scratch Scratch Tutorial Game | Scratch Game Tutorial Easy | Scratch Programming Games | Jet Shooting Game in Scratch Want to build your first arcade-style...

Top 5 Animations in Scratch | How to Make Your Animations Smooth in Scratch

In this step-by-step guide, we explore the Top 5 animations in Scratch games that will make your projects smoother, interactive, and fun to play. You’ll learn: ✅ How to make a sprite jump ✅ How to...

How to Make a Tic-Tac-Toe Game in Scratch – Easy Scratch Tutorial for Beginners

We are going to build the all-time favourite logic game in Scratch: Tic‐Tac‐Toe. In this game two players take turns making X and O on a 3×3 grid. The first one to get three in a row — across, down or...

How to Make a Real-Time Wall Clock in Scratch | Step-by-Step Scratch Tutorial

If you’ve ever wondered how to make a real-time wall clock in Scratch, you’re in the right place! In this step-by-step Scratch tutorial, we’ll show you how to build a fully functional analog clock...

How to Make a 3-Level Platformer Game in Scratch | Mario-Style Hen Adventure Game

Have you ever wanted to build your own Mario-style platformer game in Scratch? This step-by-step guide will walk you through how to make a 3-level platformer game in Scratch — featuring a jumping hen...

How to Make a Math Racing Game in Scratch | Game Concepts and Complete Tutorial

In this tutorial, you’ll learn to build a Math Racing Game in Scratch. Players solve math problems to move their character forward; wrong answers benefit the opponent. It’s a race of speed, accuracy...

How to make Memory Skill Game in Scratch | Card Matching Game in Scratch – Part 2 | Step-by-Step Coding

In this tutorial you'll learn how to make memory skill game in Scratch / card matching game in Scratch. This is a great beginner‑to‑intermediate project for scratch tutorial game, scratch programming...

How to make a Card Matching Game in Scratch | Memory Skill Game in Scratch – Part 1 | Step-by-Step Coding

In this Scratch tutorial, we'll walk you through how to make a card matching game in Scratch, also known as a memory game or skill game. This is a popular beginner project that introduces essential...

Create a Quiz Game in Scratch | Spelling Test in Scratch | Picture Identification in Scratch

Want to make learning spelling fun, visual, and interactive? In this Scratch tutorial, you'll learn how to make a spelling quiz game in Scratch using picture identification, text-to-speech, and...

How to make a Double Jump Game in Scratch | Platformer game in Scratch | Step by Step Coding

How to make a Double Jump Game in Scratch. Scratch is a fantastic platform for beginners to learn programming by making games, animations, and interactive stories. Among the many kinds of games...

How to Use Variables in Scratch | Variable Blocks in Scratch | Complete Tutorial

Introduction: Variable Blocks in Scratch Whether you’re just getting started with Scratch programming or looking to take your projects to the next level, understanding variables and lists is...

How to Make Earth Revolve Around the Sun in Scratch: A Complete Tutorial & Enhancements

Animating Earth revolving around the Sun is a classic beginner/intermediate Scratch animation project. It combines trigonometry (sine & cosine), variables, loops, and visual scripting. Kids can learn...

How to Make a Game in Scratch | Snake Game in Scratch | Step-by-Step Game Coding

In this tutorial, we’ll build a Snake Grid style game in Scratch step by step (very similar to the Kodex Academy example). By doing this, you’ll cover many of the core Scratch building blocks. We will...
Scroll to Top