A classic Chess game built using Python and Pygame, featuring a smooth graphical interface, valid move highlighting, turn-based mechanics, and standard chess rules. Whether you're a beginner or a seasoned player, this project delivers an enjoyable and intuitive chess experience right from your desktop.
- Clean and interactive GUI with Pygame
- Full implementation of chess rules
- Piece movement validation
- Check and Checkmate detection
- Stalemate detection
- Valid move highlighting
- Turn-based play (White vs Black)
- Basic AI integration (optional)
- Light-weight and beginner-friendly codebase
Main game interface showing the chess board and pieces
Active gameplay with highlighted valid moves
Make sure you have Python 3.7+ installed on your system.
-
Clone the repository:
git clone https://github.com/Subhendu-Kumar/chess_engine_py.git cd chess_engine_py
-
Install dependencies:
pip install -r requirements.txt
-
Run the game:
py main.py
- White always moves first.
- Click on a piece to view its valid moves.
- Click a highlighted square to move the selected piece.
- Checkmate and stalemate are automatically detected.
- Use the R key to reset the board.
The codebase supports plug-and-play AI move generation using minimax, negamax, and alpha-beta pruning.
To activate:
Replace self.game_mode = GameMode.HUMAN_VS_HUMAN # Default game mode
with self.game_mode = GameMode.HUMAN_VS_AI # Default game mode
├── chess_ai/
│ ├── random_move.py
├── chess_engine/
│ ├── castle_rights.py
│ ├── chess_game.py
│ ├── game_mode.py
│ ├── game_settings.py
│ ├── game_state.py
│ ├── move.py
├── images/
├── screenshots/
├── utils/
│ ├── variable_and_constants.py
│ ├── helpers.py
├── .gitignore
├── main.py
├── README.md
├── requirements.txt
Contributions are welcome! Feel free to fork the repo and submit a PR with any enhancements, bug fixes, or new features.
Thanks for checking it out! Feel free to ⭐ the repo if you found it helpful