I suspect your current code looks something like this
void OnEveryFrame()
{
MoveCar();
DrawCarToScreen();
}
But it should be like this:
void OnEveryTimerEvent()
{
MoveCar();
}
void OnEveryFrame()
{
LockTimerEvents();
DrawCarToScreen();
UnlockAndProcessOutstandingTimerEvents();
}
Of course, you must configure the appropriate timer event.
source
share