LoadingGameState starts only after InitGame finished

Hi, in my game i extend the BaseApplet class.

I've had a look at the testloadinggamestate java code and implemented it in my game.

what basicly happens is that both gamestates (maingame and loadinggamestate) start at the same time, after initGame has finished loading all the resources…

How can i make the LoadingGameState appear while i really load the game?(while initGame is happening)

    public void start()
                // Create the GameStateManager
    protected void initGame()
        //do loading and stuff
    private void loadGameStates()
         //create the main game state and attach it to the gamestate manager
        mainGameState = new RPGGameState(this);

        //set loading state
        loadingGameState = new LoadingGameState();
                GameTaskQueueManager.getManager().update(new Callable<Void>(){

         public Void call() throws Exception {
            // Create LoadingGameState and enable
            final LoadingGameState loading = new LoadingGameState();

            GameTaskQueueManager.getManager().update(new LoadingTask(loading, 0));

            return null;
    private void initRPGGame()
        //main scene node
        rootNode = new Node("root");

        //create the Z-buffer
        ZBufferState buf = display.getRenderer().createZBufferState();

        gui = new RPGGUI(displayParent, display.getRenderer(), rootNode );

        //initialize scene
        //update scene for rendering
        rootNode.updateGeometricState(0f, true);

        //set mouse input

        //enable the maingamestate

    protected void update(float interpolation) {

       // Execute updateQueue item

        // Update the GameStates
    protected void render(float tpf) {

        // Execute renderQueue item

        // Render the GameStates
    class LoadingTask implements Callable<Void> {
   private final LoadingGameState loading;
   private final int progress;

   public LoadingTask(LoadingGameState loading, int progress) {
      this.loading = loading;
      this.progress = progress;

   public Void call() throws Exception {
      String status;
      if (progress == 100) {
         status = "I'm Finished!";
      } else if (progress > 80) {
         status = "Almost There!";
      } else if (progress > 70) {
         status = "Loading Something Extremely Useful";
      } else if (progress > 50) {
         status = "More Than Half-Way There!";
      } else if (progress > 20) {
         status = "Loading Something That You Probably Won't Care About";
      } else {
         status = "Started Loading";

      loading.setProgress(progress / 100.0f, status);

      if (progress < 100) {
         GameTaskQueueManager.getManager().update(new LoadingTask(loading, progress + 1));
      return null;

I hope we'll see this game in the project or announcement section soon, it looks really cool! Very nice GUI work there :slight_smile: I'll save my questions for a more suitable thread.

Nevermind, i fixed it by loading everything using another Thread.

While the textures and GL related stuff are loaded in the main GL Thread.

so now it works.