-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMainWhack.java
More file actions
95 lines (76 loc) · 1.87 KB
/
MainWhack.java
File metadata and controls
95 lines (76 loc) · 1.87 KB
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
package whackamole;
import java.io.IOException;
import javafx.application.Application;
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.scene.Scene;
import javafx.scene.layout.AnchorPane;
import javafx.stage.Stage;
public class MainWhack extends Application{
@FXML public AnchorPane root;
@FXML public AnchorPane play;
@FXML public AnchorPane hammers;
Stage window;
Scene img, gameImg, hammerImg;
public static void main(String[] args) {
launch(args);
}
@Override
public void start(Stage primaryStage) throws Exception {
window = primaryStage;
window.setTitle("WAM WINDOW");
showMainWindow();
}
/**
* This will be the display method used by lambdas
* to call other methods/
*/
public void display(){
}
/**
* This initializes the root layout.
*/
public void showMainWindow() {
FXMLLoader loader = new FXMLLoader();
loader.setLocation(getClass().getResource("WelcomeView.fxml"));
//loader.setRoot(this);
try {
root = (AnchorPane)loader.load();
} catch (IOException e) {
e.printStackTrace();
}
img = new Scene(root);
window.setScene(img);
window.show();
}
/**
* This will initialize the gamePlay window.
*/
public void showPlayWindow(){
FXMLLoader loader = new FXMLLoader();
loader.setLocation(getClass().getResource("GameView.fxml"));
try{
play = (AnchorPane)loader.load();
}catch(IOException e){
e.printStackTrace();
}
gameImg = new Scene(play);
window.setScene(gameImg);
window.show();
}
/**
* This will be the weapon selection window
*/
public void showHammerWindow(){
FXMLLoader loader = new FXMLLoader();
loader.setLocation(getClass().getResource("GameView.fxml"));
try{
hammers = (AnchorPane)loader.load();
}catch(IOException e){
e.printStackTrace();
}
gameImg = new Scene(hammers);
window.setScene(hammerImg);
window.show();
}
}