From ee5f14665fd93e43d80c240470c3c57774072cdc Mon Sep 17 00:00:00 2001 From: Armin Benz Date: Sun, 16 Apr 2017 18:50:23 +0200 Subject: [PATCH] Back Key :) --- core/src/de/samdev/colorrunner/game/world/CRGameWorld.java | 5 +++++ .../de/samdev/colorrunner/screens/menu/EndlessGameMenu.java | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/core/src/de/samdev/colorrunner/game/world/CRGameWorld.java b/core/src/de/samdev/colorrunner/game/world/CRGameWorld.java index 5d616b7..5bf2b2c 100644 --- a/core/src/de/samdev/colorrunner/game/world/CRGameWorld.java +++ b/core/src/de/samdev/colorrunner/game/world/CRGameWorld.java @@ -2,6 +2,7 @@ package de.samdev.colorrunner.game.world; import com.badlogic.gdx.Game; import com.badlogic.gdx.Gdx; +import com.badlogic.gdx.Input; import com.badlogic.gdx.Preferences; import com.badlogic.gdx.audio.Music; import com.badlogic.gdx.math.Rectangle; @@ -57,6 +58,10 @@ public class CRGameWorld implements GameInputListener { public void update(float delta) { fps.Inc(); + Gdx.input.setCatchBackKey(true); + if(Gdx.input.isKeyPressed(Input.Keys.BACK) || Gdx.input.isKeyPressed(Input.Keys.BACKSPACE)) + ((Game) Gdx.app.getApplicationListener()).setScreen(new EndlessGameMenu(music)); + for (int i = entities.size()-1; i >= 0; i--) { CRGameEntity ent = entities.get(i); diff --git a/core/src/de/samdev/colorrunner/screens/menu/EndlessGameMenu.java b/core/src/de/samdev/colorrunner/screens/menu/EndlessGameMenu.java index 9e8c48a..ad52f75 100644 --- a/core/src/de/samdev/colorrunner/screens/menu/EndlessGameMenu.java +++ b/core/src/de/samdev/colorrunner/screens/menu/EndlessGameMenu.java @@ -47,7 +47,7 @@ public class EndlessGameMenu implements Screen { private TextButton buttonBack = new TextButton("Back", skin); private Label labelTitle = new Label("Endless Game", skin); private Label labelHighscore = new Label("Highscore: " + highScore, skin); - private Label labelLastBest = new Label("LastRounds: " + lastBest, skin); + private Label labelLastBest = new Label("Last Best: " + lastBest, skin); private Label labelTries = new Label("Tries: " + tries, skin);