-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGameDriver.java
49 lines (43 loc) · 1.53 KB
/
GameDriver.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
import javax.swing.*;
import java.awt.*;
/**
* Driving class for the CS200 game final project. Utilizes Java Swing and other components to create a game interface
*
* @author Jacob Odenthal, Owen Talberg
* @version 11/28/2023
*/
public class GameDriver{
/**
* Game manager for the experience
*/
GameManager gameSystem;
/**
* Constructor class to allow the driver to be encapsulated by a Swing window
*/
public GameDriver() {
// Window size variables for sizing
int width = 600;
int height = 600;
// Our initial game window
JFrame gameWindow = new JFrame();
gameWindow.setTitle("Rootin Tootin Revenge");
gameWindow.setSize(width, height);
gameWindow.setResizable(false);
gameWindow.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
// Creates the main gameSystem which changes locations, menus, etc.
this.gameSystem = new GameManager(gameWindow);
// Window quality changes; title of window, initial size of window, and makes it visible
this.gameSystem.startMenu(false);
// Sets the current panel to menu to start the game
gameWindow.setVisible(true);
}
/**
* This is where the magic happens
*/
public static void main(String[] args) {
// Wacky looking code I found online that supposedly helps threading issues
EventQueue.invokeLater(() -> {
GameDriver ex = new GameDriver();
});
}
}