Game Development Reference
In-Depth Information
Enemies currently die on the first hit they receive. This makes them very weak and also not
very Tower Defense-like. The enemies in these games usually have a healthbar , requiring
muliple hits before they go down. This not only makes the game more challenging, but it's
also visually appealing as you see the cannons tracking the enemies and trying to defeat
them before they move out of range. So let's create a healthbar for our enemies. Instead
of going down in one hit, they will be able to take 10 hits before being defeated.
There are muliple ways to solve this problem. But the easiest way of doing it is by creaing
muliple costumes, each with a slightly shorter healthbar graphic. Each ime an enemy gets
hit, it will advance to the next costume unil it reaches the last one, ater which it will be
destroyed. The following are the steps to create the costumes:
1. Open the enemies' Costumes tab.
2. We make sure that we are ediing the costumes in Vector Mode .
3.
Select a bright green color for the healthbar.
4.
Click on the Line tool and draw a horizontal line underneath the red circle.
5.
Create nine more costumes for the sprite by right-clicking on it and
choosing duplicate .
6.
Use the Erase tool to remove a part of the healthbar at each costume.
The last costume should have no visible bar left.
At each step, the healthbar should be shortened a litle. Since Scratch doesn't have
a ruler in its drawing tools, you can't be pixel-perfect about it. I found the best way of
doing it is to keep cuing the list of costumes in half. The irst one has a full healthbar.
The last one (number 10) has no healthbar left. So costume number five should have
only half healthbar. Costume 2.5 (which doesn't exist, so we'll pick number 3) should have
three quarters of the healthbar showing. Number 7.5 (again we pick a whole number, so 8)
should only show a quarter.
 
Search WWH ::




Custom Search