Graphics#reset()

reset(x, y, health) → {PIXI.DisplayObject}

Resets the Game Object.

This moves the Game Object to the given x/y world coordinates and sets fresh, exists,
visible and renderable to true.

If this Game Object has the LifeSpan component it will also set alive to true and health to the given value.

If this Game Object has a Physics Body it will reset the Body.

Parameters
Name Type Argument Default Description
x number

The x coordinate (in world space) to position the Game Object at.

y number

The y coordinate (in world space) to position the Game Object at.

health number <optional>
1

The health to give the Game Object if it has the Health component.

Returns
PIXI.DisplayObject -

This instance.

Inherited From
Source code: gameobjects/components/Reset.js (Line 30)
doc_phaser
2017-02-14 10:50:27
Comments
Leave a Comment

Please login to continue.