Game Development Community

onTimer callback vs. recursive scheduling?

by Man-Machine · in Torque Game Builder · 04/09/2009 (1:12 pm) · 3 replies

onTimer callback vs. recursive scheduling?

What are the pros and cons of this two methods when I'm trying to update an object every second?

Does it make any difference which method I choose? I'm not sure what's happening underneath in the engine...

#1
04/09/2009 (1:27 pm)
onTimer is just a recursive schedule, except it is done in source. The only disadvantage is that you can only have one per object.

Just go with onTimer, its nice and easy to get set up.
#2
04/10/2009 (9:45 am)
onTimer is cleaner. If you use schedule calls everywhere, you can very quickly turn it into a nightmare to manage. Using onTimer will force you to keep things centralized in one callback, which I promise you'll appreciate later on. :)
#3
04/11/2009 (12:50 am)
Thanks guys, excellent. OnTimer will be...

:)