-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathPreLude.java
More file actions
68 lines (54 loc) · 3.05 KB
/
Copy pathPreLude.java
File metadata and controls
68 lines (54 loc) · 3.05 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
package edu.sdccd.cisc190.generalstuff;
import edu.sdccd.cisc190.scenes.twelveMorning;
import javafx.geometry.Pos;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.layout.BorderPane;
import javafx.scene.layout.VBox;
import javafx.scene.text.Text;
import javafx.stage.Stage;
public class PreLude {
private Scene scene;
// Constructor to accept conviction and madness
public PreLude(Stage primaryStage, int conviction, int madness) {
// Create the game status text
//TODO: Break up text
Text gameStatus = new Text("What was that? Did the stat points that should be appearing on a “screen” increase. " +
"Apparently, everything you do is judge. Of Judgey devs. Huh what did we do-.\n" +
"“Whatever, I can do this” you say anxiously of the sanity meter that is also there.\n" +
"“But we'll probably avoid getting that meter down to 0. Just a thought”\n" +
"(We won’t tell the nightguard this but, you’ll die. Don’t do dumb sounding stuff and you won’t die. " +
"I mean unless you want to :p)\nHere you are, sitting in your new office. " +
"There’s the door to the main stage on your left, a table filled with monitors of the different cameras around the restaurant, " +
"a fan on top that barely works, and of course, a flashlight and a badge on your moldy chair " +
"that you’re sure hasn’t been cleaned in weeks… you have a bad feeling about this. How… cliche.\n");
gameStatus.setStyle("-fx-font-size: 11px; -fx-font-weight: bold;");
gameStatus.setWrappingWidth(680);
// Create the display for stats (Conviction and Madness)
Text statsText = new Text("Conviction: " + conviction + " | Madness: " + madness);
statsText.setStyle("-fx-font-size: 14px; -fx-font-weight: bold;");
// Create the action button
Button actionButton = new Button("Feeling a little 12AM?");
actionButton.setStyle("-fx-font-size: 14px;");
actionButton.setOnAction(e -> primaryStage.setScene(new twelveMorning(primaryStage).getScene()));
// Set up the BorderPane layout
BorderPane layout = new BorderPane();
// Add the gameStatus text to the top of the BorderPane
layout.setTop(gameStatus);
// Add the statsText below the gameStatus
layout.setBottom(statsText);
// Add the actionButton to the center of the BorderPane
VBox buttonLayout = new VBox(10, actionButton);
layout.setCenter(buttonLayout);
//Center the text so that it isn't directly touching the edge of the window
BorderPane.setAlignment(gameStatus, Pos.TOP_CENTER);
// Create the scene with the layout and set the preferred size
scene = new Scene(layout, 700, 400);
}
public PreLude(Stage primaryStage) {
}
// Getter for the scene
public Scene getScene() {
return scene;
}
}