Back Key :)

This commit is contained in:
Armin Benz 2017-04-16 18:50:23 +02:00
parent 23fc5af648
commit ee5f14665f
2 changed files with 6 additions and 1 deletions

View File

@ -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);

View File

@ -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);