Are we ok to build our own timers ?
JamJarRiot
Member Posts: 62
Here's my latest query, I'd really like to get something definitive on this as I plan on using it a lot.
WIll I be ok to run my own looping timers within GS? I have one up and running (an Attribute named Count1), it simply increments by 1 each time the System/Game Time reaches a 2 second period. From there, each time Count1 reaches a defined limit (i.e 4), a second counter attribute (Count2) increments and Count1 resets to zero and begins incrementing again and so on. I plan on using these different times for triggering various game objects and events and I don't want more than one GS Timer running as they are often singled out as a processor-intensive feature if overused.
Will these alternative timers be less of a burden on the iPhone than multiple Game Salad Timers? Your thoughts ?
WIll I be ok to run my own looping timers within GS? I have one up and running (an Attribute named Count1), it simply increments by 1 each time the System/Game Time reaches a 2 second period. From there, each time Count1 reaches a defined limit (i.e 4), a second counter attribute (Count2) increments and Count1 resets to zero and begins incrementing again and so on. I plan on using these different times for triggering various game objects and events and I don't want more than one GS Timer running as they are often singled out as a processor-intensive feature if overused.
Will these alternative timers be less of a burden on the iPhone than multiple Game Salad Timers? Your thoughts ?
Comments
;-)
---------------------------------------------------------------
Spiral Gyro Games
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
Here's my plan. I haven't tested this in GS yet, but I imagine it will work, and I think it may have even been discussed before.
- Create a Game integer attribute (I'll call it `10SecTimer`)
- Constrain `floor(game.time)%10` to `10SecTimer`
This should give you a counter that cycles 0-9 over ten seconds.
In my rule(set to "any") I check for `10SecTimer` = 0,2,4,6,8 and get an operation that can execute every 2 seconds.
To change the frequency of the operation I just change which values of `10SecTimer` can satisfy my rule's conditions...
I'll let you all know if it works. I think this would be a great way to phase out a lot of my timers, as long as they use whole seconds and don't last longer than 10 seconds. Although, this logic could be easily modified to work with tenths of a second... ;-)
I would love to see your's. email (my gamesalad username)@gmail.com I'm at work now, so I won't be able to test anything until I get home.