-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathChessGame.java
More file actions
47 lines (32 loc) · 1.16 KB
/
ChessGame.java
File metadata and controls
47 lines (32 loc) · 1.16 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
import javax.swing.JPanel;
import java.awt.BorderLayout;
import javax.swing.JFrame;
//CONNECTIONS: ChessBoardPanel | Settings | Player | ChessAI
public class ChessGame {
private ChessAI chessAI;
private ChessBoardPanel chessBoardPanel;
private JFrame frame;
private Settings settings;
public ChessGame(){
chessAI = new ChessAI();
chessBoardPanel = new ChessBoardPanel(chessAI);
chessAI = new ChessAI();
frame = new JFrame("Chess Game");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setLayout(new BorderLayout());
frame.add(chessBoardPanel, BorderLayout.CENTER); // Use the instance variable here
// ... Other GUI components like settings panel
settings = new Settings(chessBoardPanel);
frame.add(settings, BorderLayout.SOUTH);
frame.pack();
frame.setSize(500, 600);
frame.setVisible(true);
}
boolean PlayerTurn = true;
public static void main(String[] args) {
new Player(true);
new ChessGame();
System.out.println("Starting Game");
System.out.println("\n-------WHITE's TURN-------\n");
}
}