Ejemplo n.º 1
0
  @Override
  public void show() {
    super.show();
    GameEngine gameEngine = getGameEngine();
    gameEngine.pauseGamePlay();

    gameEngine.loadLevel(this);
  }
Ejemplo n.º 2
0
  @Override
  public void onLevelLoaded(final Level level) {
    if (level == null) {
      ErrorDialog dialog = new ErrorDialog(getStageUIActors(), "Error loading level", getSkin());
      dialog.setOnClickListener(this);
      dialog.create();
      dialog.show();
      return;
    }

    GameEngine engine = getGameEngine();
    engine.getGame().setLevel(level);

    if (engine.setup(getStageActors())) {
      this.levelLoaded = true;
      startScreenCloseAnimation();
    } else {
      ErrorDialog dialog = new ErrorDialog(getStageUIActors(), "Error setting up level", getSkin());
      dialog.setOnClickListener(this);
      dialog.create();
      dialog.show();
    }
  }