Allegro Timer

Started by
1 comment, last by Bede 16 years, 11 months ago
Hi, I'm currently building a small game using Allegro and I want to implement a feature that tells the user how long it has taken them to complete the game. Can anyone point me in the right direction for this? Basically, what I'm wanting is that when the game starts, the timer also starts and your increasing time is displayed down the bottom of the screen. When the user hits Escape, I want the timer to stop. My two main questions are: 1) How would I start/stop the timer and 2) How would I display it (using the textout_ex function maybe??)? Any help would be very much appreciated. Thanks, Bede.
Advertisement
I would use the timer functions to just increment a volatile variable 60 times a minute and count the seconds out. Remember and reassign the variable for a pause. Display with textprintf_ex, I'd say. Just my 2 cents.

Jesus saves ... the rest of you take 2d4 fire damage.

23yrold3yrold - Thank you very much. I have managed to find an example that implements what you suggested and it now appears to be working fine.

Thanks for your help,

Bede.

This topic is closed to new replies.

Advertisement