Skip to content
Shahab Hassan
All projects

Desktop game with an engineDesktop App · 2023

Chess Game

A complete chess game with bot, real-time prediction, and stunning GUI built using JavaFX

The chess board set up for a new game, with a move timer, restart, main menu and save controls down the right-hand side
01Overview

Overview

This chess game project was one of the most ambitious and rewarding projects of my academic journey. Developed as a final project for our OOP course in the 3rd semester, we chose to build a chess game, a challenge many considered nearly difficult as a beginner due to the complexity of rules and millions of possibilities in Chess, and not having AI code generation tools at the time to help us in development. We took the initiative to learn Java Swing and later JavaFX (outside of the syllabus) to give the game a polished and modern GUI. The project received high appreciation from peers and faculty for its design, logic, and attention to detail. It incorporates advanced features like playing against a Stockfish-powered AI, real-time win prediction, saving/loading games, and multiple difficulty levels, all while maintaining clean, well-structured OOP-based code.

02Features10

Features

  • 2-Player local chess gameplay
  • Play vs Bot using integrated Stockfish engine
  • Multiple difficulty levels: Easy, Medium, Hard (unbeatable)
  • Game durations: 1-minute, 3-minute, 10-minute blitz modes
  • Real-time win prediction and performance meter
  • Undo and Redo functionality
  • Save and continue game later
  • Restart and Main Menu options
  • 4 modern UI themes for board customization
  • Complete chess rule implementation (checkmate, promotion, time-based win/loss, piece validation)
03Challenges & solutions5

Challenges and solutions

  1. 01
    Challenge

    Implementing complex chess rules and validation logic

    Solution

    Carefully structured OOP logic using clean and modular Java classes for board, pieces, and rules

  2. 02
    Challenge

    Designing an intuitive and aesthetic GUI with JavaFX

    Solution

    Self-taught JavaFX to overcome Java Swing limitations and design an attractive UI

  3. 03
    Challenge

    Integrating Stockfish for bot gameplay

    Solution

    Integrated Stockfish engine with Java bindings for bot moves and difficulty tuning

  4. 04
    Challenge

    Managing real-time state like undo/redo, save/load

    Solution

    Used state management patterns to allow game saving, undo-redo, and smooth flow control

  5. 05
    Challenge

    Real-time win prediction algorithm

    Solution

    Built custom evaluation logic for real-time win/loss probability predictions


04The product9 screens

Chess Game screens