This is my implementation of the popular checkers board game using Java Swing.
CheckersModel: This class maintains the current state of the board. It contains all the logic for whether a move/jump is valid, and the game has ended/winner is found. It stores the LinkedList of all versions of the board as well as the method for the undo feature. It also contains the methods for saving and loading the game.
GameBoard: This class instantiates a CheckersModel object, which is the model for the game. This class handles user clicks–the model is updated every time the user clicks the game board. Whenever the model is updated, the game board repaints itself and updates the message at the bottom of the window.
RunCheckers: This class instantiates a GameBoard object, and sets up the top-level frame and widgets for the GUI. This class implements controller functionality with the various buttons such as Reset, Undo, Save, Load, and Instructions.
Game: Runs the main game
- 2D Arrays
- Collections (LinkedLists, Maps)
- File I/O
- JUnit Testing
cd main
Java Game.java