forked from ssalabura/Rods-and-Harpoons
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Program.java
58 lines (50 loc) · 1.86 KB
/
Program.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
package application;
import database.JsonSavefile;
import database.MongoDB;
import javafx.application.Application;
import javafx.application.Platform;
import javafx.scene.image.Image;
import javafx.stage.Stage;
import scenes.*;
import java.util.logging.Level;
public class Program {
public static void main(String[] args) {
Application.launch(MainApp.class, args);
}
public static class MainApp extends Application {
public static final int WIDTH = 900;
public static final int HEIGHT = 650;
public static Stage primaryStage;
public static MainMenu mainMenu;
public static Settings settings;
public static GameScene gameScene;
public static MatchHistory matchHistory;
public static HighScores highScores;
public static MongoDB mongoDB;
public static JsonSavefile jsonSavefile;
@Override
public void start(Stage stage) {
java.util.logging.Logger.getLogger("org.mongodb.driver").setLevel(Level.SEVERE);
mongoDB = new MongoDB();
jsonSavefile = new JsonSavefile("game.sav");
primaryStage = stage;
primaryStage.setTitle("Rods and Harpoons");
stage.getIcons().add(new Image("logo_small.png"));
primaryStage.setOnCloseRequest(e -> {
Platform.exit();
System.exit(0);
});
mainMenu = new MainMenu(WIDTH,HEIGHT);
mainMenu.load();
settings = new Settings(WIDTH, HEIGHT);
settings.load();
gameScene = new GameScene(WIDTH,HEIGHT);
matchHistory = new MatchHistory(WIDTH, HEIGHT);
matchHistory.load();
highScores = new HighScores(WIDTH, HEIGHT);
highScores.load();
primaryStage.setScene(mainMenu);
primaryStage.show();
}
}
}