TransitionGameState only starts after game is loaded

i have implemented a TransitionGameState from this thread which was very helpful

however my game still starts with a black screen. the TransitionGameState only appears after the game is completely loaded. which of course is not what i want :slight_smile: (then once it's loaded, the TransitionGameState works great w/ splash image, progress bar, dissolve, etc.)

so can someone please tell me what i'm doing wrong? ideally the TransitionGameState would appear quickly/immediately after the application launches.

There's your problem, you extended StandardGame.  :P  If you are extending StandardGame that means you've done something wrong. :wink:

Instantiate StandardGame, call start() on StandardGame, then create your TransitionGameState and add it to the scene.  After that has loaded properly THEN start loading the rest of the game.

i'm still not following the logic…

if by "loading the rest of the game" you mean initGame() and initSystem(), then those are called automatically as a result of me calling start() on StandardGame, correct? i.e. i can't "pause" them.

thus, how can i add TransitionGameState after start() and still get it to be before initGame()?

for example, in this code snippet, the entire initGame/initSystem cycle completes before the GameState code is executed. so is start() blocking?

many thanks in advance for the help.

Don't extend StandardGame, just instantiate it.

.start() blocks until the game loop has started.

Use game states for just about everything in the game. So after you have attached the loading state, you instantiate and attach your main menu state (and pass it the loading state to report progress). But not inside StandardGame, just leave it to do its thing.

Yes, exactly. :slight_smile:

thanks that works. much appreciated.