Skip to content
This repository was archived by the owner on Sep 4, 2023. It is now read-only.

Commit 6f3d18b

Browse files
committed
fix labs
1 parent c86f263 commit 6f3d18b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+14452
-16
lines changed

.DS_Store

0 Bytes
Binary file not shown.
Binary file not shown.
0 Bytes
Binary file not shown.

2110215_Lab5_2022_1_6430082021_Yanapat/.idea/vcs.xml

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

2110215_Lab5_2022_1_6430082021_Yanapat/.idea/workspace.xml

+73-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

2110215_Lab5_2022_1_6430082021_Yanapat/.project

+11
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,15 @@
1414
<natures>
1515
<nature>org.eclipse.jdt.core.javanature</nature>
1616
</natures>
17+
<filteredResources>
18+
<filter>
19+
<id>1669507740648</id>
20+
<name></name>
21+
<type>30</type>
22+
<matcher>
23+
<id>org.eclipse.core.resources.regexFilterMatcher</id>
24+
<arguments>node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
25+
</matcher>
26+
</filter>
27+
</filteredResources>
1728
</projectDescription>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
eclipse.preferences.version=1
2+
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
3+
org.eclipse.jdt.core.compiler.codegen.targetPlatform=14
4+
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
5+
org.eclipse.jdt.core.compiler.compliance=14
6+
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
7+
org.eclipse.jdt.core.compiler.debug.localVariable=generate
8+
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
9+
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
10+
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
11+
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
12+
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
13+
org.eclipse.jdt.core.compiler.release=enabled
14+
org.eclipse.jdt.core.compiler.source=14

2110215_Lab5_2022_1_6430082021_Yanapat/bin/.gitignore

-1
This file was deleted.

2110215_Lab5_2022_1_6430082021_Yanapat/bin/META-INF/MANIFEST.MF

-3
This file was deleted.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
-7.8 KB
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<classpath>
3+
<classpathentry kind="src" path="src"/>
4+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-12">
5+
<attributes>
6+
<attribute name="module" value="true"/>
7+
</attributes>
8+
</classpathentry>
9+
<classpathentry kind="lib" path="C:/Program Files/Java/javafx-sdk-14/lib/javafx.base.jar"/>
10+
<classpathentry kind="lib" path="C:/Program Files/Java/javafx-sdk-14/lib/javafx.controls.jar"/>
11+
<classpathentry kind="lib" path="C:/Program Files/Java/javafx-sdk-14/lib/javafx.fxml.jar"/>
12+
<classpathentry kind="lib" path="C:/Program Files/Java/javafx-sdk-14/lib/javafx.graphics.jar"/>
13+
<classpathentry kind="lib" path="C:/Program Files/Java/javafx-sdk-14/lib/javafx.media.jar"/>
14+
<classpathentry kind="lib" path="C:/Program Files/Java/javafx-sdk-14/lib/javafx.swing.jar"/>
15+
<classpathentry kind="lib" path="C:/Program Files/Java/javafx-sdk-14/lib/javafx.web.jar"/>
16+
<classpathentry kind="lib" path="C:/Program Files/Java/javafx-sdk-14/lib/javafx-swt.jar"/>
17+
<classpathentry kind="output" path="bin"/>
18+
</classpath>

2110215_Lab6_2022_1_6430082021_Yanapat/.idea/.gitignore

+8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

2110215_Lab6_2022_1_6430082021_Yanapat/.idea/.name

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

2110215_Lab6_2022_1_6430082021_Yanapat/.idea/misc.xml

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

2110215_Lab6_2022_1_6430082021_Yanapat/.idea/vcs.xml

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>Lab6_2021_2_ToStudent</name>
4+
<comment></comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
<buildCommand>
9+
<name>org.eclipse.jdt.core.javabuilder</name>
10+
<arguments>
11+
</arguments>
12+
</buildCommand>
13+
</buildSpec>
14+
<natures>
15+
<nature>org.eclipse.jdt.core.javanature</nature>
16+
</natures>
17+
<filteredResources>
18+
<filter>
19+
<id>1669507740652</id>
20+
<name></name>
21+
<type>30</type>
22+
<matcher>
23+
<id>org.eclipse.core.resources.regexFilterMatcher</id>
24+
<arguments>node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
25+
</matcher>
26+
</filter>
27+
</filteredResources>
28+
</projectDescription>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
eclipse.preferences.version=1
2+
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
3+
org.eclipse.jdt.core.compiler.codegen.targetPlatform=12
4+
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
5+
org.eclipse.jdt.core.compiler.compliance=12
6+
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
7+
org.eclipse.jdt.core.compiler.debug.localVariable=generate
8+
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
9+
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
10+
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
11+
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
12+
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
13+
org.eclipse.jdt.core.compiler.release=enabled
14+
org.eclipse.jdt.core.compiler.source=12
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
package application;
2+
3+
import component.KeyboardPane;
4+
import component.PlayerPane;
5+
import component.TimerPane;
6+
import component.TurnPane;
7+
import javafx.application.Application;
8+
import javafx.application.Platform;
9+
import javafx.event.EventHandler;
10+
import javafx.geometry.Insets;
11+
import javafx.geometry.Pos;
12+
import javafx.scene.Scene;
13+
import javafx.scene.layout.Background;
14+
import javafx.scene.layout.BackgroundFill;
15+
import javafx.scene.layout.CornerRadii;
16+
import javafx.scene.layout.HBox;
17+
import javafx.scene.layout.StackPane;
18+
import javafx.scene.layout.VBox;
19+
import javafx.scene.paint.Color;
20+
import javafx.stage.Stage;
21+
import javafx.stage.WindowEvent;
22+
import logic.GameLogic;
23+
24+
public class Main extends Application {
25+
26+
@Override
27+
public void start(Stage primaryStage) throws Exception {
28+
GameLogic.init();
29+
30+
StackPane root = new StackPane();
31+
root.setBackground(new Background(new BackgroundFill(Color.WHITE, CornerRadii.EMPTY, Insets.EMPTY)));
32+
33+
Scene scene = new Scene(root, 854,512);
34+
35+
VBox mainVBox = new VBox();
36+
mainVBox.setAlignment(Pos.TOP_CENTER);
37+
38+
HBox topPane = new HBox();
39+
40+
TimerPane tp1 = new TimerPane(0);
41+
TimerPane tp2 = new TimerPane(1);
42+
43+
TurnPane turn = new TurnPane();
44+
45+
GameLogic.setTimerPane(0, tp1);
46+
GameLogic.setTimerPane(1, tp2);
47+
GameLogic.setTurnPane(turn);
48+
49+
topPane.setPrefWidth(854);
50+
topPane.setAlignment(Pos.CENTER);
51+
52+
topPane.getChildren().add(tp1);
53+
topPane.getChildren().add(turn);
54+
topPane.getChildren().add(tp2);
55+
56+
mainVBox.getChildren().add(topPane);
57+
58+
//============Set up Middle Pane=========
59+
PlayerPane p1 = new PlayerPane(0);
60+
PlayerPane p2 = new PlayerPane(1);
61+
62+
GameLogic.setPlayerPane(0, p1);
63+
GameLogic.setPlayerPane(1, p2);
64+
65+
HBox middlePane = new HBox();
66+
middlePane.setPrefWidth(854);
67+
middlePane.setAlignment(Pos.CENTER);
68+
69+
middlePane.getChildren().add(p1);
70+
middlePane.getChildren().add(p2);
71+
72+
mainVBox.getChildren().add(middlePane);
73+
//=========================================
74+
75+
KeyboardPane kb = new KeyboardPane();
76+
77+
GameLogic.setKeyPane(kb);
78+
79+
mainVBox.getChildren().add(kb);
80+
81+
//Canvas canvas = new Canvas(854,480);
82+
root.getChildren().add(mainVBox);
83+
84+
primaryStage.setTitle("Word Royale");
85+
primaryStage.setScene(scene);
86+
primaryStage.show();
87+
88+
GameLogic.prepareTurns(0);
89+
90+
//This is so all the threads exits properly upon closing the program.
91+
primaryStage.setOnCloseRequest(new EventHandler<WindowEvent>() {
92+
@Override
93+
public void handle(WindowEvent e) {
94+
Platform.exit();
95+
System.exit(0);
96+
}
97+
});
98+
99+
}
100+
101+
public static void main(String[] args) {
102+
launch(args);
103+
}
104+
105+
}

0 commit comments

Comments
 (0)