The Health component provides the ability for Game Objects to have a
that can be damaged and reset through game code.
Requires the LifeSpan component.
Damages the Game Object. This removes the given amount of health from the
If health is taken below or is equal to zero then the
killmethod is called.
Heal the Game Object. This adds the given amount of health to the
health : number
The Game Objects health value. This is a handy property for setting and manipulating health on a Game Object.
It can be used in combination with the
damagemethod or modified directly.
maxHealth : number
The Game Objects maximum health value. This works in combination with the
healmethod to ensure the health value never exceeds the maximum.