A fully functional, rule-compliant Chess game written in Python. It features a custom-built engine with a Pygame graphical user interface and smooth piece animations.
Unlike simple tutorials, this project implements the complete set of Chess rules, including complex edge cases.
- Complete Ruleset: Fully supports Castling and En Passant captures.
- Interactive Promotion: When a pawn reaches the end, a options appear to let the player choose the promotion piece (Queen, Rook, Bishop, or Knight).
- Local Multiplayer: 2-player hot-seat mode.
- Smooth Animations: Pieces glide to their target squares rather than teleporting.
- Modern Tooling: Project managed with
uvfor fast dependency resolution.
- Language: Python 3
- GUI Library: Pygame
- Package Manager: uv
This project uses uv for dependency management, ensuring a reproducible environment.
Ensure you have uv installed. If not:
pip install uvClone the repository:
git clone https://github.com/Alireza2317/chess-gui-python
cd chess-gui-pythonSync dependencies and launch:
uv sync
uv run main.py.
├── assets/ # Sprites and images for pieces
├── chess/ # 🧠 Core Engine (Board logic, Move validation, Rules)
├── gui/ # 🎨 Rendering logic (Drawing board, Event handling)
├── main.py # Entry point
├── pyproject.toml # Project configuration
└── uv.lock # Dependency lockfile
The following features are currently being developed in experimental branches:
- Move History: Full move recording with persistent storage.
- Undo/Redo System: Implementation of the Command Pattern for game state reversal.
- CLI Mode: A fully text-based terminal version of the game.
- FEN loader and exporter
- and much more ...
