Problems with StandardGame

I started porting to StandardGame recently, and I have some problems doing so. I want to add stuff to update() and render(), that actually keeps updated and rendered every frame. I've tried adding a new Callable to the GameTaskQueueManager, but it looks like they get only called once. How do I prevent this behavior and make sure it gets called every frame? :?

If I understand correctly you'll need to create your own custom GameState and register it with the manager.  Once it's activated it's update and render methods will get called every frame by Standard Game automatically.

So that means i'll have to extend a gamestate? ie:


public class MyCustomGameState extends PhysicsGameState {

public MyCustomGameState() {
// put here the initGame stuff
}

public void update() {
super.update();
thingymabob.update();
}



Pretty much.  That's sort of the whole point of StandardGame.  What previously you would have had to do in the Game you'll now typically do in a GameState.

Thank you very much, it works now.

GameStates are very cool…I use them seemingly as they were designed to be used: I separate out different aspects of the game and create my own GameState for that.



For instance, I have a standard AudioGameState that I can use for any game I plan on making, and just override a method to do the proper loading.  In my recent demo (not finished), I have stuff like a menu GUI in its own GameState, audio, terrain+models+game/movement logic (might need to be split up, possibly), in-game GUI, skybox, and third person camera state (may be one I missed).  The cool part is that you can enable and disable GameStates at will, and it just kind of starts working.  So, when the game starts up, I initialize all of my GameStates, then only enable the menu GUI and the audio, so you can hear some music while at the menu.  When done, I just disable the menu GUI and enable the ones set for in-game.



Lots of options and flexibility.