A feature-rich, high-performance Chess application built with JavaFX. This project implements full Chess logic, advanced gameplay rules, and a professional-grade user interface designed for a premium local multiplayer experience.
- Castling: Support for both Kingside and Queenside castling with valid move checking (ensuring path is clear and squares aren't under attack).
- Pawn Promotion: Automatically triggers a selection dialog when a pawn reaches the opposite rank (Queen, Rook, Bishop, Knight).
- En Passant: Fully implemented capture logic according to official FIDE rules.
- Check & Checkmate Detection: Real-time validation of move legality to prevent players from leaving their King in check.
- Draw Detection: Automatic detection of Stalemate and Insufficient Material (e.g., King vs King).
- Dynamic Board Rotation: "Pass-to-Play" mode where the board automatically flips to the current player's perspective.
- Move History Log: A live sidebar tracking every move in standard coordinate notation.
- Captured Pieces Tracker: Visual "trophy" area showing pieces taken by each player.
- Coordinate System: Full 'a-h' and '1-8' labels that reorient with the board.
- Visual Feedback: Last-move highlighting (gold border) and landing pulse animations for pieces.
- High-Contrast Aesthetics: Deep dark-themed sidebar with crisp, outline-styled unicode pieces for maximum visibility.
- Implemented path traversal collision detection for sliding pieces (rook, bishop, queen)
- Built legal move generation with king safety validation
- Developed board state simulation for checkmate/stalemate analysis
- Implemented attack-square computation to validate castling constraints
- Designed state tracking for en passant and move history replay
- Maintained strict separation between engine logic and UI rendering
- Language: Java 17+
- Framework: JavaFX 21
- Build System: Maven
- Styling: Vanilla CSS (with JavaFX
-fx-properties)
- JDK 17 or higher
- Apache Maven
- Clone the repository:
git clone <repository-url> cd Chess
- Run the application using Maven:
mvn javafx:run
The project follows a clean, modular structure for easy maintenance:
com.chess.engine: The central game logic (GameEngine). Manages state, validation, and rules independent of the UI.com.chess.ui: JavaFX components. Handles the 10x10 grid rendering, coordinate labels, and sidebar updates.com.chess.model: Core data structures. Includes Piece classes, Position, and Move history models.resources: Global stylesheet (style.css) defining the professional dark theme and piece aesthetics.
The codebase is thoroughly documented with "developer-to-developer" comments. If you're looking to extend the game (e.g., adding an AI or PGN export), check the comments in GameEngine.java and ChessBoardUI.java for implementation details.
This project is open-source and available under the MIT License.