Method: deathTime

Gets / sets the timestamp in milliseconds that denotes the time that the entity will be destroyed. The object checks it's own death time during each tick and if the current time is greater than the death time, the object will be destroyed.
deathTime (Number val, Function deathCallback)
  • Numberval The death time timestamp. This is a time relative to the engine's start time of zero rather than the current time that would be retrieved from new Date().getTime(). It is usually easier to call lifeSpan() rather than setting the deathTime directly.
  • 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 death time of the entity to 60 seconds after engine start

© 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