50 lines
1.3 KiB
Java
Raw Normal View History

2023-02-25 13:55:35 +01:00
/*
* This Java source file was generated by the Gradle 'init' task.
*/
package school_project;
import javafx.application.Application;
2023-05-04 23:24:18 +02:00
import javafx.scene.Parent;
2023-02-25 13:55:35 +01:00
import javafx.scene.Scene;
2023-05-04 23:24:18 +02:00
import javafx.scene.input.KeyCombination;
import javafx.stage.Screen;
2023-02-25 13:55:35 +01:00
import javafx.stage.Stage;
2023-05-04 23:24:18 +02:00
import school_project.Parsers.FileParserFactory;
import java.io.File;
import java.io.IOException;
2023-02-25 13:55:35 +01:00
public class Controller extends Application {
2023-05-04 23:24:18 +02:00
private Stage stage;
Parent root;
public static Vec2 screen_size;
2023-02-25 13:55:35 +01:00
@Override
2023-05-04 23:24:18 +02:00
public void start(Stage primaryStage) throws IOException {
stage = primaryStage;
screen_size = new Vec2(
(int) Screen.getPrimary().getBounds().getWidth(),
(int) Screen.getPrimary().getBounds().getHeight()
);
stage.setTitle("ROAD TO MASTER YOU");
2023-02-25 13:55:35 +01:00
2023-05-04 23:24:18 +02:00
// Full Screen mode
stage.setFullScreen(true);
stage.setFullScreenExitHint("");
primaryStage.setFullScreenExitKeyCombination(KeyCombination.NO_MATCH);
2023-02-25 13:55:35 +01:00
2023-05-04 23:24:18 +02:00
root = new GameUI(FileParserFactory.loadMapFromFile(new File(getClass().getResource("level11.level").getFile())));
2023-02-25 13:55:35 +01:00
2023-05-04 23:24:18 +02:00
Scene scene = new Scene(root, screen_size.x, screen_size.y);
stage.setScene(scene);
stage.show();
2023-02-25 13:55:35 +01:00
}
public static void main(String[] args) {
launch();
}
}