mirror of
https://github.com/photonstorm/phaser
synced 2024-11-23 13:13:43 +00:00
Sprite.alive property now explicitly defined on the Sprite prototype (thanks @lewster32, #841)
This commit is contained in:
parent
2a73652ed8
commit
bcddfc83c0
3 changed files with 9 additions and 1 deletions
|
@ -52,6 +52,8 @@ Version 2.0.6 - "Jornhill" - -in development-
|
|||
|
||||
### Bug Fixes
|
||||
|
||||
* Sprite.alive property now explicitly defined on the Sprite prototype (thanks @lewster32, #841)
|
||||
|
||||
### Migration Guide
|
||||
|
||||
There is an extensive [Migration Guide](https://github.com/photonstorm/phaser/blob/master/resources/Migration%20Guide.md) available for those converting from Phaser 1.x to 2.x. In the guide we detail the API breaking changes and approach to our new physics system.
|
||||
|
|
2
build/phaser.d.ts
vendored
2
build/phaser.d.ts
vendored
|
@ -3724,7 +3724,7 @@ declare module Phaser {
|
|||
circle: Phaser.Circle;
|
||||
clientX: number;
|
||||
clientY: number;
|
||||
duation: number;
|
||||
duration: number;
|
||||
exists: boolean;
|
||||
game: Phaser.Game;
|
||||
id: number;
|
||||
|
|
|
@ -116,6 +116,12 @@ Phaser.Sprite = function (game, x, y, key, frame) {
|
|||
*/
|
||||
this.body = null;
|
||||
|
||||
/**
|
||||
* @property {boolean} alive - A useful boolean to control if the Sprite is alive or dead (in terms of your gameplay, it doesn't effect rendering). Also linked to Sprite.health and Sprite.damage.
|
||||
* @default
|
||||
*/
|
||||
this.alive = true;
|
||||
|
||||
/**
|
||||
* @property {number} health - Health value. Used in combination with damage() to allow for quick killing of Sprites.
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue