Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/drewstone/chess
Chess game implemented in Java using Swing
https://github.com/drewstone/chess
Last synced: 2 days ago
JSON representation
Chess game implemented in Java using Swing
- Host: GitHub
- URL: https://github.com/drewstone/chess
- Owner: drewstone
- Created: 2015-10-05T20:55:26.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2015-10-05T20:59:22.000Z (about 9 years ago)
- Last Synced: 2023-03-06T12:40:00.545Z (over 1 year ago)
- Language: Java
- Homepage:
- Size: 113 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.txt
Awesome Lists containing this project
README
README for CHESS:
Object oriented design:
Game class runs entire framework and has some extra buttons to create new game, resign, and quit the frame.
Chess class that creates mechanics of chess game and initiates the game
Player class that contains basic information about the player, i.e color of player.
ChessBoard class that builds swing UI and runs the chess mechanics
Board is created using JPanels and JLabels and actual chessboard is created with a 2D array of Squares.Square class that contains basic information about a square on a chessboard.
Squares contain nothing or a piece, I can retrieve the pieces from squares and move them to different squares.Piece class that implements basic methods to retrieve info about pieces
Pawn through King pieces extend Piece class and override certain methods specific to certain pieces, such as isValid. Use array lists to store all valid moves and then check if specific move is contained within all possible moves to instantiate valid movement. Each piece is its own object, I can create and remove pieces.