Using the game clock for timers- Anyone have a tutorial or video?
design219
Member Posts: 2,273
I am working on a new game and starting to use a lot of timers. I've seen posts about using the game clock instead of timers for better efficiency, but as a non programing guy, I'm not getting how to put this into action.
Anybody have/know of a video or tutorial that could help?
Anybody have/know of a video or tutorial that could help?
Comments
Create a new attribute called something like 'delay'. Set it to whatever you want.
It works like this:
Change Attribute: self.capturedTime To: game.Time
Rule
When all conditions are valid:
game.Time > self.capturedTime + self.delay
-----[do something]
Sorry for the nooby questions.
And Thanks!
For capturedtime, i would use a real.
Thanks!
Nevermind, I got it.
*Another timing need...
*I want to make something happen every 16 seconds. Any suggestions on the most efficient way to do that with the game clock?
Change Attribute: self.capturedTime To: game.Time
Inside the Rule
When all conditions are valid:
game.Time > self.capturedTime + self.delay
-----[do something]
-----(here)Change Attribute: self.capturedTime To: game.Time