@Override public void render() { Gdx.gl.glClearColor(1, 1, 1, 1); Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT); shapeR.setProjectionMatrix(cam.combined); batch.setProjectionMatrix(cam.combined); loadingBar.draw(batch, shapeR); }
@Override public void update(float dt) { this.dt = dt; percent = runner.battlesDone() / (float) total * 100.0f; loadingBar.setText((int) percent); if (runner.isFinished()) { System.out.println("Done!"); System.out.println(fighter1.getName() + " wins: " + runner.getWins(fighter1)); System.out.println(fighter2.getName() + " wins: " + runner.getWins(fighter2)); Fighter winner = runner.getWinner(); if (winner != null) System.out.println("Winner: " + winner.getName() + "!"); else System.out.println("Draw!"); this.gsm.setState(GameStateManager.REPLAY); } }