Phaser.Component. Health

new Health()

The Health component provides the ability for Game Objects to have a health property that can be damaged and reset through game code. Requires the LifeSpan component.

Source - gameobjects/components/Health.js, line 14

Members

damage

Damages the Game Object. This removes the given amount of health from the health property.

If health is taken below or is equal to zero then the kill method is called.

Source - gameobjects/components/Health.js, line 36

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 damage method or modified directly.

Default Value:
  • 1
Source - gameobjects/components/Health.js, line 25
Phaser Copyright © 2012-2015 Photon Storm Ltd.
Documentation generated by JSDoc 3.3.0-alpha10 on Thu Mar 26 2015 02:53:50 GMT+0000 (GMT Standard Time) using the DocStrap template.