@Override public void hide() { try { state.save(); } catch (IOException e) { throw new RuntimeException("Couldn't save level", e); } state.getLevel().destroy(); super.hide(); }
@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); }
@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; } }