Space Age has four levels; for each level, a special enemy sprite is responsible for the attack and they are as follows:
In the starter project, there are only two enemy sprites: Rock and Mother Ship. Both the Rock and Mother Ship have complete scripts and are ready to participate in the game. We will copy Rock to create Monster and Robot, and then tweak their local variables to increase the difficulty.
The Rock sprite attacks by crashing and firing ammo. When created as a clone, it continues to fall down at a random speed and randomly fires rounds. The speed of falling as well as the frequency of firing the ammo are configured through min_speed
, max_speed
, and shoot_random_wait
.
Before duplicating Rock to create new sprites, first test the Rock sprite by playing the game. Click on the green flag, and hit the Start button to start playing. If all is well, you should see the Level One information page scrolling by and the Rock clones shown as a drove. Hold the ammo, because we have yet to add scripts to the Spaceship Ammo sprite.
Monster
.<chap4_images_dir>costumesenemiesmonster
, select normal.svg
and hit.svg
, and click on OK.Now, let's create the Robot sprite:
Robot
.<chap4_images_dir>costumesenemies
obot
and then import normal_robot.svg
and hit_robot.svg
.Let's make Monster and Robot faster and shoot out more ammo. To do so, we will change the min_speed
, max_speed
, and shoot_random_wait
variables. Navigate to Monster's Scripts tab and change its scripts as follows:
4
to 5
.8
to 10
.1000
to 100
(wait less, shoot more often).The final script will look like the following screenshot:
Repeat the same steps for Robot, but make it harder:
4
to 6
.8
to 10
.1000
to 75
(wait less, shoot more often).The final script will look like the following screenshot:
3.133.132.99