Game Development Reference
In-Depth Information
13. As a final step, to make sure the enemies always start at costume number 1
when the game starts, we place a switch costume to <costume1> block
in the <green lag> script. Note that this is the name of the costume.
Test the game again to see that the enemies are indeed showing a healthbar and are losing
health as they get shot, before disappearing ater being hit 10 imes. Now, we are well on
our way to creaing an enjoyable game.
To make things even more interesing, we will create two more enemy types. These behave
in largely the same way as the first enemy. But with some minor changes to their scripts,
we can make them behave quite differently. We will create a faster enemy that takes less
ime to travel the length of the road. We will also create a slower enemy that is harder to
kill than the first enemy. Each type of enemy will be depicted in a different color.
Let's start with the fast enemy, the blues. The following are the steps to create it:
1.
Right-click on the enemy sprite in the Sprites view and select duplicate to make a
copy of this sprite and all its scripts.
2.
Go to the Costumes tab of the copied sprite and change its color from red to blue
using the Fill tool. You have to recolor all the costumes.
3.
Then go to the Scripts tab to make some changes.
 
Search WWH ::




Custom Search