Switching Backgrounds/Levels in Scratch

November 10th, 2010 by Brian Leave a reply »

For the STEM video game challenge, we’re using Scratch to make our games.

One of the things you usually need in a video game is the ability to change what the background looks like. First, you’ll need to create the backgrounds in Scratch:

I’ve created two backgrounds using the built-in paint editor. They’re very intricate backgrounds named “background1” and “background2”. You can name yours differently, just remember what you called them.


These scripts:

  1. Reset the background to background1 at the start.
  2. Broadcast either a Go to 1 or Go to 2, depending on what key is pressed.
  3. The script checks what’s broadcast and changes the level’s appearance.
Advertisement

Leave a Reply