Beispiel #1
0
 @Override
 public void hide() {
   try {
     state.save();
   } catch (IOException e) {
     throw new RuntimeException("Couldn't save level", e);
   }
   state.getLevel().destroy();
   super.hide();
 }
Beispiel #2
0
  @Override
  public void render(float delta) {
    // limit the tick time to assist in debugging
    delta = Math.min(delta, 0.1f);

    Gdx.gl.glViewport(0, 0, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
    updater.update(state.getLevel(), delta);
    renderer.render(state.getLevel(), delta);

    super.render(delta);
  }
Beispiel #3
0
 @Override
 public void act(float delta) {
   Char hero = game.getPlayer();
   Visual visual = hero.getVisual();
   float x = visual.x();
   float y = visual.y();
   if (x != preX || y != preY) {
     Camera camera = gameCamera;
     camera.position.set(x, y, 0);
     camera.update();
     preX = x;
     preY = y;
   }
 }