Game Development Reference
In-Depth Information
Objective complete - mini debriefing
The first wave of enemies are now happily flying across the screen. We will add a bit more
funcionality later. The enemies will be able to kill the player character upon touching him,
and likewise, they may be killed by the player if he uses his weapon.
But let's first add a few different enemies.
Adding enemy patterns
We will create two more enemy types that follow diferent atack paterns. The starish in
our first sprite are moving in a straight line one after the other. For the second enemy sprite,
we will create a script that causes that enemy to spread out, making it a bit harder to avoid.
For the third enemy, we will write a script that makes this enemy type a bit unpredictable,
moving in a wavy patern and turning unexpectedly.
Prepare for lift off
Before we begin scriping, we need two more enemy sprites, which we will create using the
following steps:
1. Right-click on the Starfish3 sprite and choose duplicate . Do this twice to create two
more enemy sprites, including the enemy sprite scripts.
2. To difereniate between the three enemy types, we will recolor the second and
third sprites.
3. For the second sprite, we select a blue color and fill the body of the sprite with it.
4.
For the third sprite, we select a yellow color and do the same.
The sprites are automaically renamed as Starfish2 and Starfish3 as shown in the following
screenshot. This is fine for our purposes, so there is no need to manually change the names.
 
Search WWH ::




Custom Search