2

I want to quit the game, if 2 values are higher than 3. I want to put in in here:

        if(player.getWorldTranslation().y > 3){
            if(player.getWorldTranslation().z > 3){
                 
            }

I guess its in the documentation, but I still could´nt find any answer after 10minutes searching. Thanks for helping!

Reisbrot
  • 37
  • 9

2 Answers2

1

I think, the best(if you need to stop the game and not the program):

static Main app;//Put the app variable global and static
...

public static void main(String[] args) {
   app = new Main();
   app.start();
}
...

if(player.getWorldTranslation().y > 3){
    if(player.getWorldTranslation().z > 3){
        app.Stop(1);
        //System.exit(1);//if you need close the entire program;
    }
Luis Correa
  • 174
  • 1
  • 6
0

Here's a link to quitting the game. You could also use System.exit(int). Either way it works.

Luke Melaia
  • 1,470
  • 14
  • 22