Animate Dreams Gotta buy them all! (Consumer whore)

Age:37 Gender: Joined: May 01 2004 Posts: 821 Location: Middle Tennessee Offline
|
Posted: Tue Apr 10, 2007 3:15 pm Post subject: Game Timers |
 |
|
|
|
I just found something that looks cool. I was looking through game.h when I found this callback:
/** this callback called when the game timer expires. */
#define CB_TIMESUP "timesup"
/** the type of CB_TIMESUP
* @param arena the arena whose timer is ending
*/
typedef void (*GameTimerFunc)(Arena *arena); |
I was just using a normal timer from the mainloop module for an event, but if there is a timer specifically for events, I would of course rather use that. I looked around in the source to find more about game timers, but all I found was gametimer.c, which seems to be more concerned with in-game commands than functions. All I want to do is start a timer for the game, which will call a function when it ends to stop the game. But I'm assuming that if I used a gametimer, I could just use the CB_TIMESUP to handle stopping the game. But, it kind of looks like gametimer wasn't really created for this, in which case I should just ignore this and just use a normal timer. So, can anyone give me some information on game timers? |
|