Dirty Chess is a sophisticated, feature-rich desktop chess application built with Python. It leverages the power of the Pygame ecosystem and the Stockfish engine to provide a professional-grade chess experience. The project features a robust scene-based architecture, dynamic JSON-driven theming, and precise move validation using the python-chess library. Whether you are playing against another human or challenging the integrated AI, Dirty Chess offers a clean and responsive interface designed for both casual play and technical analysis.
- Engine Integration: Support for Stockfish for high-level AI move generation and position analysis.
- Dynamic Theming: Fully customizable UI components, including pieces, boards, and buttons, via external JSON configuration files.
- Scene Management: A structured state-machine approach managing Welcome, Menu, and Gameplay transitions.
- Advanced Move Logic: Complete chess rule enforcement including promotion, castling, and stalemate detection.
- Interactive UI: Real-time move history tracking, informational feedback panels, and sound effects for an immersive experience.
- Configuration Management: Pydantic-validated settings for display, assets, and game board parameters.
Follow these steps to set up the project on your local machine:
-
Clone the Repository:
git clone git@github.com:Ddilibe/Chess.git cd Chess -
Environment Setup: Ensure you have Python 3.12+ installed. It is recommended to use a virtual environment:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install Dependencies:
pip install .Note: The project requires
pygame,pygame-gui,chess, andpydantic. -
Stockfish Engine: Ensure the Stockfish binary is placed in the
assets/engine/directory as referenced inengine/engine.py.
To launch the application, run the main.py file from the root directory:
python main.py- Select Piece: Left-click on any piece to see valid moves highlighted in blue.
- Move: Click on a highlighted square to execute the move.
- Promotion: A selection window will automatically appear when a pawn reaches the 8th rank.
- Reset: Press
Rafter a game concludes to restart. - Menu: Press
ESCto return to the main menu at any time.
| Technology | Purpose |
|---|---|
| Python 3.12 | Core programming language |
| Pygame | Graphics rendering and event handling |
| Pygame-GUI | Interactive UI elements and theming |
| python-chess | Move validation and board logic |
| Pydantic | Data validation and settings management |
| Stockfish | Chess engine for AI opponents |
Dilibe Fidelugwuowo
- Email: Franklinfidelugwuowo@gmail.com
- GitHub: Ddilibe
- LinkedIn: [Your Username]
- Twitter: [Your Username]
