Back Key :)
This commit is contained in:
parent
23fc5af648
commit
ee5f14665f
@ -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);
|
||||
|
||||
|
@ -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);
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user