User Guide

119
The position of the spawn point is calculated using scrollX, in the
same way as the background sprites and masks are positioned.
Assuming the x position of the spawn sprite is 88 and the first
screen starts at coordinate 0,0 then the position of the spawn
sprite can be calculated as 88 - scrollX.
When the spawn point touches the Billy sprite, it:
1. Sets CanScroll to 0 to stop the background
scrolling.
2. Sets EnemiesRemaining to 1.
3. Broadcasts the message “Spawn1”.
4. Hides itself so that no further collisions between it
and the Billy sprite are detected.
Now you need to make Williams1 respond to this message. Add
the following script to respond to Spawn1 messages. The two
scripts on the sprite should now be:
To create a new spawn point for the second screen, calculate the
position of the new sprite with the second background sprite
fully in view. The second background sprite starts at 480,0, so
the position of the second spawn point is the x value (from the
Scripts Area) plus 480 and then minus scrollX.
Making Williams Attack
To make the Williams1 sprite attack the player, you need to add
a loop that runs until the sprite is defeated. This loop:
1. Points the sprite in the direction of the Billy sprite.