User Guide

103
To do all of this, add the following script to the L1M1 sprite:
Now copy this script into the other four background sprites:
1. Right-click the when I receive StartGame block,
and then click duplicate.
2. Move the mouse pointer to the Sprite List, and click
L1M2.
Repeat this process for the remaining background sprites.
Scrolling the Background
The scrolling in this project works like this:
1. There is a variable called scrollX that controls the
position of the background.
2. When scrollX is zero, all of the background sprites
are in their default position.
3. Each background sprite calculates its position
slightly differently, so that they appear one by one.
4. If scrollX is changed, the background sprites
recalculate their position. For example, if scrollX is
changed to 10, then all of the background sprites
will move 10 pixels to the left.
5. Sprites that have an x position of greater than 462
will stay in the area on the right side of the Stage.
6. Sprites that have an x position of less than -462 will
all be in the unusable area on the left-hand side of
the Stage.
Add the variable scrollX to the project: