mirror of
https://github.com/photonstorm/phaser
synced 2024-12-18 09:03:29 +00:00
32 lines
576 B
TypeScript
32 lines
576 B
TypeScript
/// <reference path="../../_definitions.ts" />
|
|
|
|
module Phaser.Particles.Initializers {
|
|
|
|
export class Life extends Initialize {
|
|
|
|
constructor(a,b,c) {
|
|
|
|
super();
|
|
|
|
this.lifePan = ParticleUtils.setSpanValue(a, b, c);
|
|
|
|
}
|
|
|
|
lifePan: Phaser.Particles.Span;
|
|
|
|
initialize(target) {
|
|
|
|
if (this.lifePan.a == Infinity)
|
|
{
|
|
target.life = Infinity;
|
|
}
|
|
else
|
|
{
|
|
target.life = this.lifePan.getValue();
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|