User Guide
Table Of Contents
118
You already have the variable CanScroll which is used to stop the
player scrolling the background when enemies appear or when
the end of the level is reached. But you need one that holds how
many enemies must be defeated before scrolling is re-enabled.
Call this EnemiesRemaining, and make it visible to all sprites.
To detect when the player reaches a point when enemies
appear, create another invisible sprite. This is sometimes called
a “spawn point”.
1. Start the game and then stop it on the first screen.
2. In the Sprite List, click Paint new sprite.
3. Draw a solid-color rectangle and then click OK.
4. This sprite must be tall enough to block the player’s
path. Drag the sprite into position on the Stage,
and edit the costume if it is not large enough.
5. In the Scripts Area, rename the sprite Spawn1.
6. Make a note of the x position of the sprite.
7. Add the following scripts to the spawn point: