Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Furwerkstudio on Mon 01/03/2021 02:30:53

Title: Setting up a thirty second timer.
Post by: Furwerkstudio on Mon 01/03/2021 02:30:53
I was wondering how does one set up a thirty second timer, I did look up timers but I could not figure out how the cycles worked in relation to seconds.
Title: Re: Setting up a thirty second timer.
Post by: Gilbert on Mon 01/03/2021 02:56:13
Code (ags) Select
SetTimer(1, GetGameSpeed()*30);

GetGameSpeed() returns the frame(cycle) rate your game is current running at. For example, if your game is running at 40 FPS (AGS default), you can set the time to 40*30 = 1200 cycles for 30 seconds.