Enemy Health Bar Example


Use the arrow keys to move, press space to shoot

The enemies have health bars above them. Those health bars are separate object which are attached on the enemy with an attach behavior block.

In order to change the value of the health bar you have to send a message to it. In the message block there is an option to send to all attachments (the health bar is the only attachment in this case). Then when we receive the message on the health bar we can change the its appearance with an animation block.