A simple, fully functional chess game implemented in Java using Swing. Play classic chess against another player on the same computer, with all standard rules supported.
- Complete chess rules: legal moves, check, checkmate, stalemate
- Special moves: castling, pawn promotion, en passant
- Visual board and piece movement
- Turn-based play (White vs Black)
- Game status display (turn, check, checkmate, stalemate)
Add screenshots here if available
- Java JDK 8 or higher
- Clone or download this repository.
- Compile the source code:
- Using command line:
javac -d out src/main/*.java src/piece/*.java
- Or use your favorite IDE (IntelliJ IDEA, Eclipse, etc.) to import the project and build.
- Using command line:
- Run the game:
- Using command line:
java -cp out main.Main
- Or run
Main.java
from your IDE.
- Using command line:
src/
main/
Main.java # Entry point
GamePanel.java # Main game logic and rendering
Board.java # Board drawing
Mouse.java # Mouse input handling
Type.java # Piece type enum
piece/
Piece.java # Base class for all pieces
Pawn.java # Pawn logic
Rook.java # Rook logic
Knight.java # Knight logic
Bishop.java # Bishop logic
Queen.java # Queen logic
King.java # King logic
- Click and drag pieces to move them.
- Only legal moves are allowed.
- When a pawn reaches the last rank, select a piece to promote to.
- The game will display messages for check, checkmate, and stalemate.
- Developed by Anish Ghanwat
- Piece images and board colors inspired by classic chess sets.
This project is licensed under the MIT License.