//todo instead of going back to main menu, pause the game with pause screen?
@Override
    public void show() {
        super.show();
        this.x = r.nextFloat();
        this.y = r.nextFloat();
        float angle = r.nextFloat() * 2 * 3.14159f;
        this.vx = (float)java.lang.Math.cos(angle);
        this.vy = (float)java.lang.Math.sin(angle);
        //todo instead of going back to main menu, pause the game with pause screen?
        Gdx.input.setCatchBackKey(true);
        getStage().addListener(new InputListener() {
            @Override
            public boolean keyUp(InputEvent event, int keycode) {
                if (keycode == Input.Keys.BACK || keycode == Input.Keys.ESCAPE) {
                    app.setScreen(app.getMainScreen());
                    return true;
                } else {
                    return false;
                }
            }
        });
    }
this.vx = (float)java.lang.Math.cos(angle);
this.vy = (float)java.lang.Math.sin(angle);
//todo instead of going back to main menu, pause the game with pause screen?
Gdx.input.setCatchBackKey(true);
getStage().addListener(new InputListener() {
@Override
public void show() {
super.show();
this.x = r.nextFloat();
this.y = r.nextFloat();
float angle = r.nextFloat() * 2 * 3.14159f;
this.vx = (float)java.lang.Math.cos(angle);
this.vy = (float)java.lang.Math.sin(angle);
//todo instead of going back to main menu, pause the game with pause screen?
Gdx.input.setCatchBackKey(true);
getStage().addListener(new InputListener() {
@Override
public boolean keyUp(InputEvent event, int keycode) {
if (keycode == Input.Keys.BACK || keycode == Input.Keys.ESCAPE) {
app.setScreen(app.getMainScreen());
return true;
} else {
return false;
}
@Override
public void show() {
super.show();
this.x = r.nextFloat();
this.y = r.nextFloat();
float angle = r.nextFloat() * 2 * 3.14159f;
this.vx = (float)java.lang.Math.cos(angle);
this.vy = (float)java.lang.Math.sin(angle);
//todo instead of going back to main menu, pause the game with pause screen?
Gdx.input.setCatchBackKey(true);
getStage().addListener(new InputListener() {
@Override
public boolean keyUp(InputEvent event, int keycode) {
if (keycode == Input.Keys.BACK || keycode == Input.Keys.ESCAPE) {
app.setScreen(app.getMainScreen());
return true;
} else {
return false;
}
}
});
}