Chess Game is a 2 player Chess python application. This project implements a graphical chess interface using Tkinter, allowing users to play chess interactively on a visually rendered board.
- The chessboard is displayed using a Tkinter
Canvas. - Light and dark squares alternate, providing a classic chessboard look.
- Chess pieces are rendered using images loaded from the
imagesdirectory. - Images are dynamically scaled to fit the square size for a responsive UI.
- Players can select and move pieces by clicking on the board.
- Highlights valid moves for the selected piece.
- Enforces turn-based play (white and black alternate turns).
- Validates moves using the
MoveGeneratorclass. - Animates piece movements, including special moves like castling.
- Tracks the current player's turn.
- Automatically switches turns after a valid move.
- Detects game-ending conditions such as checkmate or stalemate.
- Displays the game result using message boxes.
- Smooth animations for piece movements and castling enhance the user experience.
- The board dynamically adjusts to an 800x800 layout.
- Integrates with
BoardandMoveGeneratormodules to validate and execute game logic.
chess-engine/
├── images/ # Folder containing chess piece images.
├── board.py # Module for board representation and logic.
├── move_generator.py # Module for generating and filtering moves.
├── chess_ui.py # Main GUI script.
├── README.md # Project documentation.
- Ensure that you have Python 3.x installed.
- Install required dependencies:
pip install pillow
- Place the chess piece images in the
images/directory. The filenames should match the following convention:white-king.png,white-queen.png,white-rook.png,white-bishop.png,white-knight.png,white-pawn.pngblack-king.png,black-queen.png,black-rook.png,black-bishop.png,black-knight.png,black-pawn.png
- Run the GUI:
python chess_ui.py
-
AI Integration:
- Implement an AI opponent using algorithms like Minimax with Alpha-Beta pruning.
-
Analyze Mode:
- Add features like move suggestions, blunder detection, and alternative lines using the move generator.
-
Customizability:
- Allow customization of board and piece colors and square sizes.
- Python 3.x
- Tkinter: Comes pre-installed with Python.
- Pillow: For handling chess piece images.
Contributions are welcome! Please create a pull request with a detailed description of your changes.
