Game Development Community


#1
04/01/2008 (5:38 am)
You may want to look at the schedule() function

function Bomb::onCollision (%this){
   echo("The bomb will go off in 60 seconds");
   %this.schedule(60000, "explode"); // 60,000 ms
}

function Bomb::explode(%this){
   // explode code goes here
}

The functions may need additional parameters for datablock-object pairs ( like %this, %obj ), I'm not entirely sure.

Note: the schedule function is not guarunteed to be totally accurate, so it may not be exactly 60 seconds, but it will be close.

You could also incrementally schedule a ticking function for 1 second intervals (60 times) and sending ui updates to the player for feedback.
#2
04/01/2008 (2:57 pm)
Nothing, delete this account.