Game Development Community

Continuous behaviour

by Daniel Buckmaster · in Torque Game Engine · 02/03/2007 (9:27 am) · 2 replies

This is a similar question to one in another post, but the situation is different.
How do I create continuous behaviour for an object in script only? For example, each frame, I want my player object to do something (in this case, alter the location of another object). I tried a simple test, getting a ShapeBase object to print "hi" to the console with the processTick() method, but nothing happens.
Another solution posted was to use schedule(), but I don't know if that will work.

About the author

Studying mechatronic engineering and computer science at the University of Sydney. Game development is probably my most time-consuming hobby!


#1
02/03/2007 (10:34 am)
I don't know if it's a good/recommended/efficient way to do it but you can schedule method calls... ie:

function begin()
{
schedule(1, 0, update);
}

function update()
{
schedule(50, 0, update); // where 50 is the time in ms and "update" the method to be called
}
#2
02/03/2007 (1:19 pm)
Hmm... and then I'd put my code to alter an object's position into 'update'?