If I am using StandardGame and want to update an object every x amount of seconds? How might this be done? Should I just make a loop and use Thread.sleep()? I'm pretty sure you guys will have a better way, can't think of any other way to do it.
u dont need to use thread for this. simply get the interpolation value and keep tracking that. put something like this inside ur update method.
time += interpolation;
if(time >= x)
{
updateObject();
time = 0;
}
what update method? I am using standardgame…
I guess I have to add a controller to the node that I want to update.
When using StandardGame, it will call the update(int interpolation) method in each of the GameStates added to your StandardGame. In that update method you should do your checks. So, just override the existing update() method in the GameState(s) you're using.
Another way you might consider, depending on how many events you have to time, is creating an ordered Tree/List of events whose timers decrement each time you update, and then you remove+run all of the events whose timers have expired.