Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Gord10 on Mon 19/01/2004 15:12:17

Title: Countdown
Post by: Gord10 on Mon 19/01/2004 15:12:17
How can I add countdown to my game?
For example, if we can't shoot a monster in 2 seconds, we will die.
Title: Re:Countdown
Post by: Ben on Mon 19/01/2004 15:18:01
To start the timer:

SetTimer(timer,amount);

where "timer" is which timer you want to use (1-10) and "amount" is the number of loops to wait (40 loops = 1 second).

To check if the timer has counted down to zero, put this in the repeatedly execute script:

if(IsTimerExpired(timer)) == 1 {
 //Put code for what happens here..
}
Title: Re:Countdown
Post by: Gord10 on Mon 19/01/2004 16:44:08
Thank you! :)