Skip to content

CevinGurung/Chess

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

JavaFX Professional Chess

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.

🚀 Key Features

♟️ Advanced Gameplay Rules

  • 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).

🎨 Professional UI & UX

  • 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.

Engineering Challenges Solved

  • 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

🛠️ Technology Stack

  • Language: Java 17+
  • Framework: JavaFX 21
  • Build System: Maven
  • Styling: Vanilla CSS (with JavaFX -fx- properties)

📥 Installation & Running

Prerequisites

  • JDK 17 or higher
  • Apache Maven

Build and Run

  1. Clone the repository:
    git clone <repository-url>
    cd Chess
  2. Run the application using Maven:
    mvn javafx:run

🏗️ Project Architecture

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.

📝 Developer Notes

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.

📜 License

This project is open-source and available under the MIT License.

About

A pass to play chess game created using java and JavaFX

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors