Fixed launcher failing to start if game.set is absent

This commit is contained in:
François Autin 2021-06-23 15:03:27 +02:00
parent 26f3512372
commit f9043d6deb
2 changed files with 10 additions and 4 deletions

View File

@ -71,12 +71,19 @@ public class Config {
System.out.println("button for up is : " + up); */
} catch (FileNotFoundException e) {
e.printStackTrace();
File f = new File("game.set");
try {
f.createNewFile();
} catch (IOException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
System.exit(1);
}
parse();
} catch (IOException e) {
e.printStackTrace();
} catch (ParseException e) {
e.printStackTrace();
System.out.println("Empty config file");
}
}

View File

@ -86,7 +86,6 @@ public class Launcher extends Application {
public void runGame() {
try {
int width, height;
System.out.println(namespace.size());
ChoiceBox<String> cb = (ChoiceBox<String>) namespace.get("resolution");
switch (cb.getValue()) {
case "640x480":