WCK: Main game loop

Hi again guys,

I've started developing a game using the WCK.

I'm trying to find somewhere to put my main loop, where I safely add and remove game objects. Where do I do this? I've looked around for a method which is called on enterframe but havent found anything yet,

thanks in advance
Just listen for the Event.ENTER_FRAME or the StepEvent.STEP events off of the world object. Example:

Code:
listenWhileVisible(world, StepEvent.STEP, gameLoop, false, 10);


Note the priority - 10 - negative priorities are called after the time step and positive before. "listenWhileVisible" is like addEventListener but will automatically remove the listener when the object is no longer visible. This is the method BoxMan in the demo uses to parse keyboard input.

Also you could just extend wck.World and override the "step" function.
ah interesting... this warrants some tinkering =]

Original thread: https://box2d.org/forum/viewtopic.php?t=5349