lifespan(time: number, options?: LifespanCompOpt): EmptyComp
Destroy the game obj after certain amount of time
param
time- The time to live.
param
options- Options for the lifespan component. See
// spawn an explosion, destroy after 1 seconds, start fading away after 0.5 second add([ sprite("explosion", { anim: "burst", }), lifespan(1, { fade: 0.5 }), ])
returns
The lifespan comp.
since
v2000.0