ASSS Questions - Game Timers Animate Dreams - 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?
Smong - Tue Apr 10, 2007 3:50 pm Post subject:
I think CB_TIMESUP is just for the ?timer and TimedGame setting.
I think in subgame if TimedGame is on at the end stats are displayed and scores are reset, last time I checked asss does not do this. Plus it ends with a ding instead of a hallellula.
I would just make my own timers for my events and leave CB_TIMESUP alone (especially since gametimer has no interface).