Game Development Reference
When the power is gone (all red), Shield is destroyed and the game is over.
Shield Life displays the shield power grid by changing its costumes, each at a power
grid damage level. The technique to display damage level with costumes is to match the
costume number with the number of hits. Scratch costumes start from one, instead of
zero, so costume#1 depicts zero hit, costume#2 for one hit, and so on.
Prepare for lift off
Shield Life has two local variables: num_shield_hits and num_max_hits . The
number_shield_hits variable tracks how many hits the Shield sprite has suffered, and
the num_max_hits variable tells the maximum number of hits that Shield can take before
its complete destrucion.