I want to implement a countdown timer in a game,
but need some help figuring out how to do it properly.
I know that this is probably a very regular question that has been asked a thousand times, but I've been trying out some methods I found through searching, but can't get them to work for whatever reason.
Basically, I want a timer (probably 120 seconds or so) to countdown, and if the player hasn't completed the objective before the timer reaches zero, then the level will restart.
I think I can figure out the rest of it, but I just need some help getting an actual timer up and counting.
I assumed I would use whatever countdown function, while printing the current time to the screen with:
textprintf_ex(screen, font, 300, 0, RED, BLACK, "Time: %d", time_left);
Help please? Thanks :)