Stopinga countdown timer & getting that info
Posted: Mon Mar 26, 2012 10:07 am
I'm trying to stop a countdown timer once my player hits a checkpoint and then get that time to use in a bonus screen
Here is the code I'm using for the timer. I can't figure out how to stop it.
Global Script
Timer - Create Actor - Script
Timer - Draw Actor - Script
Here is the code I'm using for the timer. I can't figure out how to stop it.
Global Script
- Code: Select all
int SecLeft = 30;
int VirtSec = 30;
int NumFrames = 0;
Timer - Create Actor - Script
- Code: Select all
sprintf(text, "%i", VirtSec);
Timer - Draw Actor - Script
- Code: Select all
if(NumFrames >= real_fps)
{
if(SecLeft > 0)
{
SecLeft -= 1;
if(VirtSec <= 0)
{
VirtSec = 59;
}
else
{
VirtSec -= 1;
}
sprintf(text, "%02d", VirtSec);
}
NumFrames = 0;
}
else
{
NumFrames += 1;
}