A sophisticated Python-based chess game with a modern graphical interface built using Pygame. This project implements a complete chess game with all standard rules and piece movements, featuring a clean and intuitive user interface.
- Complete chess game implementation with all standard piece movements
- Interactive graphical interface built with Pygame
- Real-time move validation and legal move highlighting
- Visual indicators for possible moves and piece selection
- Checkmate detection and game-ending logic
- Game state tracking and move history
- Undo move functionality (using Backspace)
- Time tracking for both players
- Game history saving with detailed move logs
- Support for special moves:
- Castling (Kingside and Queenside)
- Pawn promotion
- Clone the repository:
git clone https://github.com/Dashtiss/Chess-AI.git
cd chess-ai- Install dependencies:
pip install -r requirements.txt- Make sure you have Python and pip installed
- Run the build script:
chmod +x build.sh # Make the script executable
./build.shThe macOS app will be created in the dist directory as ChessAI.app
- Make sure you have Python and pip installed
- Run the build script:
build_windows.batThe Windows executable will be created in the dist directory as ChessAI.exe
If you prefer to run from source instead of building:
- Install dependencies:
pip install -r requirements.txt- Run the game:
python main.pypython main.py- Click on a piece to select it
- Green circles will appear showing all possible legal moves
- Click on a highlighted square to move the piece
- Use Backspace to undo your last move
- Press ESC to quit the game
- Left Mouse Click: Select and move pieces
- Backspace: Undo last move
- ESC: Exit game
main.py: Main game loop and UI handlingMovementManger.py: Chess move validation and piece movement logicDataClasses/:Board.py: Chess board state managementPieces.py: Chess piece definitions and properties
GameInfoMenu.py: Game information display and time trackingsettings.py: Game configuration settings
- AI opponent implementation with multiple difficulty levels
- Opening book integration for AI gameplay
- Custom theme support
- Save/Load game functionality
- Move suggestion system
- Chess puzzle mode
- Rating system for players
- Tournament mode
- Analysis board with move evaluation
- Integration with chess engines (e.g., Stockfish)
- Python 3.7+
- Pygame 2.5.0+
- Additional requirements listed in requirements.txt
MIT License - See LICENSE file for details
Contributions are welcome! Please feel free to submit a Pull Request.