Vote count:
0
When my game finishes, i'm trying to change the screen to the end game screen, but instead of doing so, it simply flashes the game screen. I belive it is clearing the stage, but then drawing it again without moving to the next screen? Can you advise please.
@Override
public void render(float v) {
Gdx.gl.glClearColor(0, 0, 0, 1);
Gdx.gl.glClear(GL10.GL_COLOR_BUFFER_BIT);
Gdx.input.setInputProcessor(stage);
if (state == gamestate.PAUSED) {
// draw pause screen
}
else if (state == gamestate.GAMEOVER || score <= 0) {
game.setScreen(new endGameScreen(game, score));
stage.clear();
}
else {
player.update();
stage.draw();
batch.begin();
etc...
asked 1 min ago
Aucun commentaire:
Enregistrer un commentaire