Game Development Reference
In-Depth Information
Creating enemies
We will quickly create an enemy sprite to make use of the background we just drew.
These enemies will follow the path drawn in the background. Because the background
image is fixed, we can determine exactly where the turns are. We will use a simple
movement script that sends the enemies along the path from one end of the stage to the
other. Like with the targets in the previous project, we will use a base object that creates
clones of itself that will actually show up on stage.
Prepare for lift off
We will first draw an enemy sprite. Let's keep this simple for now. We can always add to
the visual design later. The steps to draw it are as follows:
1. Click on the paintbrush icon to create a new sprite.
2. Choose a red color and draw a circle. Make sure the circle is a proper size
compared to the path in the background.
3. Fill the circle with the same color.
4. We name the new sprite enemy1 .
That's all for now! We will add more to the appearance of the enemy sprite later.
The enemy sprite appears as a red circle large enough to fit the path.
Engage thrusters
Let's make it funcional irst with a script. We will place the base enemy sprite at the
start of the path and have it create clones. Then we will program the clones to follow
the path as shown in the following steps:
1. The script will start when the when <green lag> clicked block is clicked.
2. Place the sprite at the start of the path with a go to x: -240 y: 0 block.
3. Wait for three seconds by using the wait ... secs block to allow the player
to get ready for the game.
 
Search WWH ::




Custom Search