Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: De-Communizer on Tue 16/09/2008 13:27:03

Title: Making something happen every few seconds...
Post by: De-Communizer on Tue 16/09/2008 13:27:03
Hi there, I was wondering about making something change states every few seconds. For example, if I have a security camera - what I want to do is every five seconds, make it swing around to a different angle (which I'd do by changing the sprite, since it's an image) and changing which region on the floor is "active" (to simulate the camera's field of view). How would I make it so that both the active region, and the camera's appearance change every few seconds?

Thanks in advance for your help!
Title: Re: Making something happen every few seconds...
Post by: Khris on Tue 16/09/2008 13:37:44
You'd use a Timer (http://www.adventuregamestudio.co.uk/manual/SetTimer.htm).

As for changing the active region, either enable it and disable the previously active one (by changing their .Enabled property to true/false) or use a variable holding the current active region's number.