52 lines
1.5 KiB
Java
52 lines
1.5 KiB
Java
package nl.minkema.leendert;
|
|
|
|
import de.codecentric.centerdevice.javafxsvg.SvgImageLoaderFactory;
|
|
import javafx.application.Application;
|
|
import javafx.scene.Scene;
|
|
import javafx.stage.Stage;
|
|
|
|
import java.util.Properties;
|
|
|
|
/**
|
|
* @author J0QUE
|
|
* @version 1.0
|
|
*/
|
|
public class Main extends Application {
|
|
public static Scene scene;
|
|
|
|
@Override
|
|
public void start(Stage primaryStage) throws Exception {
|
|
|
|
SvgImageLoaderFactory.install();
|
|
|
|
primaryStage.setTitle("Het spectaculaire tuinavontuur");
|
|
scene = new Scene(new Menu(), 1200, 800);
|
|
primaryStage.setScene(scene);
|
|
primaryStage.setResizable(false);
|
|
primaryStage.show();
|
|
}
|
|
|
|
|
|
public static void main(String[] args) throws Exception {
|
|
|
|
Properties properties = new Properties();
|
|
properties.load(Main.class.getResourceAsStream("/text/locations.properties"));
|
|
Game.locations = new int[properties.size()][2];
|
|
for (int i = 0; i < properties.size(); i++) {
|
|
String[] split = properties.getProperty(String.valueOf(i)).split(",");
|
|
Game.locations[i] = new int[]{Integer.parseInt(split[0]), Integer.parseInt(split[1])};
|
|
}
|
|
|
|
int[][] locations = Game.locations;
|
|
for (int i = 0; i < locations.length; i++) {
|
|
int[] k = locations[i];
|
|
if (k[0] == k[1] && k[0] == 0) {
|
|
throw new Exception("Invalid Location at index " + i);
|
|
}
|
|
}
|
|
|
|
|
|
launch(args);
|
|
}
|
|
}
|