User Guide
Table Of Contents
117
5.5 Enemies
When the player reaches set points in the level, the scrolling
stops and the game “spawns” enemies that the player must
defeat. Only having two enemies on screen at once (like the NES
game) is a sensible limitation for this project.
Prepare the graphics for an enemy sprite in a similar way as
described in section 5.3 The Player Sprite on page107. Enemies
only need nine costumes, as shown in Figure 4 below.
Figure 4. Nine costumes for the first enemy. Original artwork ©1989 Technos Japan
Corp.
Name the sprite “Williams1” in Scratch and set it to only face left
and right. Drag the sprite where you want it to appear on the
Stage.
Add the following script to this sprite:
The enemy needs two variables: Defeated and Hits. Defeated is
used to ensure that the sprite only moves and attacks until the
player defeats it. Hits is the health of the enemy and is reduced
when the player hits the sprite. Add these variables to the
Williams1 sprite only by selecting the For this sprite only option.