IgeEntity

Method: lifeSpan

Gets / sets the life span of the object in milliseconds. The life span is how long the object will exist for before being automatically destroyed.
lifeSpan (Number milliseconds, Function deathCallback)
  • Numbermilliseconds The number of milliseconds the entity will live for from the current time.
  • FunctiondeathCallback Optional callback method to call when the entity is destroyed from end of lifespan.
Returns * "this" when arguments are passed to allow method chaining or the current value if no arguments are specified.

Set the lifespan of the entity to 2 seconds after which it will automatically be destroyed

entity.lifeSpan(2000);
© Copyright 2013 Irrelon Software Limited. All Rights Reserved. UK Registered Company Number: 07522767
Isogenic (ī´sōjen´ik): Adj originating from a common source; possessing the same genetic composition.
Strange Things Happen at the One Two Point