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;
}