integer GetGametime()
Return the game time in 1/1000s. This is the elapsed time from the start of the game you can use to do timing tasks.
none
An integer number giving the time in 1/1000s.
// Listing #1: Bouncing clock
Time <- 0;
Flag_UpDown <- false;
function Voxel_Step()
{
// The robot will play at 1 second interval.
if ( (GetGameTime() - Time) > 1000 )
{
// Display the actual time.
Display( "GAME TIME : " + GetGameTime(), 500, 2);
// Move the robot up and down following the 1 second rythm.
if ( Flag_UpDown ) Move (4);
else Move (5);
Flag_UpDown = ! Flag_UpDown;
// Store actual timestamp for the next 1 second delay.
Time = GetGameTime();
}
}
none