How to Create Game Loop? (Torque Script)
by beyond · in Torque Game Engine Advanced · 02/18/2011 (8:53 am) · 2 replies
Hi!
Early i worked with events of objects & place my code
fragments to events callbacks.
But I don't understand very important thing - How
to Create Game Loop? Where I can place my code
for objects moving, animation, e.t.c.?
Thanks.
Early i worked with events of objects & place my code
fragments to events callbacks.
But I don't understand very important thing - How
to Create Game Loop? Where I can place my code
for objects moving, animation, e.t.c.?
Thanks.
#2
Ideally you would break down the game into many small loops: one for each monster walking around, one for clouds floating by, etc. You can control each part of the game independantly. You can have the keyboard polled every 75ms but the main character animated at 50fps.
04/04/2011 (5:19 pm)
If your game absolutely needs a game loop you can create one. Call a function named "GameLoop" when the level loads and schedule a call to "GameLoop" as the last line so that the function is called every 50ms.Ideally you would break down the game into many small loops: one for each monster walking around, one for clouds floating by, etc. You can control each part of the game independantly. You can have the keyboard polled every 75ms but the main character animated at 50fps.
Torque 3D Owner Ronny Bangsund
Torque Cheerleaders