예제 #1
0
  /**
   * Update the display entries.
   *
   * @param container the container that holds the game
   * @param delta the time in milliseconds since the last update
   */
  public void update(@Nonnull GameContainer container, int delta) {
    if (!active) {
      return;
    }

    int centerX = container.getWidth() >> 1;
    int centerY = container.getHeight() >> 1;

    int offX = (centerX - origin.getDcX()) + dX;
    int offY = (centerY - origin.getDcY()) + dY - dL;

    Avatar av = World.getPlayer().getCharacter().getAvatar();
    if (av != null) {
      glueAvatarToOrigin(av);
      corridor.setCorridor(av);
    }

    Camera.getInstance().setViewport(-offX, -offY, container.getWidth(), container.getHeight());

    Input engineInput = container.getEngine().getInput();
    gameScene.publishEvent(
        new CurrentMouseLocationEvent(engineInput.getMouseX(), engineInput.getMouseY()));
    gameScene.update(container, delta);
    updateFog(container);
    updateDeadView(container);
  }