/** * Handle all world logic. This involves updating entity positions, calculating collisions, etc. * * @param dt change in time since last frame (in seconds) */ private void loop(float dt) { // We should call the world.step(float dt, int velocityIterations, int positionIterations) // recommended velocityIterations is 8 and positionIterations is 3 // OR we could also call it in the render method down below. keyboard.handleKeyboard(); sceneManager.update(dt); }
@Override public void render() { float dt = Gdx.graphics.getDeltaTime(); loop(dt); Gdx.gl.glClearColor(0, 0, 0, 1); Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT); // illustration of basic drawing sceneManager.render(); }