Home> Blog>  How to Make a Scrolling Background in Scratch | Online Scratch Tutor

How to Make a Scrolling Background in Scratch | Online Scratch Tutor

how to make a scrolling background in scratch

Want to make your Scratch game look like it’s moving? You’ve probably seen cool games where the background scrolls as the player walks or flies. It’s not as hard as it looks!

In this simple guide, we’ll teach you how to make a scrolling background in Scratch, step-by-step. No need to be a pro. If you're just starting out with Scratch or want your games to feel more alive, this tutorial is for you.

Let’s go!


What is a Scrolling Background?

A scrolling background is when the backdrop moves across the screen to create the illusion that your character is traveling. Think of platformers like Mario or endless runners like Flappy Bird.

Instead of the player moving through a huge stage, the background moves while the player stays mostly in place. This makes the game look dynamic and gives it a sense of motion.


What You’ll Need

Before we start, make sure you have:

  • A Scratch account (scratch.mit.edu)

  • A simple backdrop image (you can draw it or upload one)

  • A sprite (your character)


Step-by-Step: Creating a Scrolling Background in Scratch

Step 1: Set Up Your Stage

  1. Open a new Scratch project.

  2. Delete the default cat sprite if you want.

  3. Click on "Choose a Backdrop" and pick or draw one that looks like it can loop (like a landscape or road).

Step 2: Add Two Background Sprites

To make the background scroll, we need two copies of the same backdrop image. Here's how:

  1. Choose or draw your backdrop as a sprite, not as the stage background.

  2. Duplicate the sprite so you have two copies.

  3. Place one on the left side of the screen and one right next to it on the right.

This creates a seamless background loop.

Step 3: Code the Background to Scroll

Now we’ll write code so both background sprites move left, creating a scrolling effect.

Click on the first background sprite and add this code:

when green flag clicked
forever
    change x by -2
    if x < -480 then
        set x to 480
    end
end

Then, do the same for the second background sprite.

What this does:

  • Moves the sprite to the left

  • When it moves off-screen, it jumps to the other side

  • The two sprites take turns looping, making it look like an endless scroll

Step 4: Add Your Player Sprite

Now add your character sprite (a car, dinosaur, bird, etc). Place it somewhere in the middle of the screen. You can add jump, move, or fly controls later if you want!


Tips to Make It Look Even Cooler

  • Use parallax scrolling: Have the background move slower than the foreground for a 3D effect.

  • Add obstacles or items: Make your game interactive.

  • Use sound effects and music: Make the game feel alive.


Common Mistakes (and How to Fix Them)

  • Gaps between backgrounds? Make sure your background image edges match perfectly.

  • Sprites not looping right? Double-check the x-position reset in your code.

  • Too slow or too fast? Adjust the change x by -2 value to change speed.


Practice with a Tutor from Tutree 🎓

Want some help or feedback on your Scratch game? Tutree connects you with expert tutors who love teaching coding to kids like you!

Whether you're building your first game or want to make a more advanced scrolling world, a Tutree tutor can guide you step-by-step.

Click here to sign up and find your Scratch tutor now!


Final Thoughts

Learning how to make a scrolling background in Scratch is a big step in creating cool, dynamic games. Once you’ve mastered this, you can build platformers, endless runners, and more.

Keep practicing, keep creating, and most of all—have fun!

Happy coding!


Need help learning Scratch faster? Tutree has you covered. Get started with a tutor today!