Python Chess Game banner

Python Chess Game

1 devlogs
3h 55m 19s

Made a Chess Game using Python and Pygame Library
File Flow:
Chess Game
├── board.py
├── constants.py
├── game.py
├── main.py
├── promotion.py
├── images/
│ ├── black-bishop.png
│ ├── black-king.png
│ ├── black-knight.png
│ ├── black-pawn.png
│ ├── black-queen.png
│ ├── black-rook.png
│ ├── white-bishop.png
│ ├── white-king.png
│ ├── white-knight.png
│ ├── white-pawn.png
│ ├── white-queen.png
│ └── white-rook.png
└── pieces/
├── init.py
├── bishop.py
├── king.py
├── knight.py
├── pawn.py
├── piece.py
├── queen.py
└── rook.py

Loading README...

shahaarav2806

Shipped this project!

Hours: 3.92
Cookies: 🍪 33
Multiplier: 8.54 cookies/hr

Title: Building a Chess Game with Object-Oriented Python

For my first project of the “12 Weeks 12 Projects” challenge, I decided to tackle a classic: Chess. Built entirely in Python with Pygame, this project focuses on clean architecture and game state management.

Technical Highlights:

OOP Architecture: structured with a modular design separating the
Game
loop,
Board
rendering, and individual Piece classes (King, Queen, Rook, etc.).
Recursion & Logic: Implemented a
check_options
predictive algorithm to look ahead and filter out moves that would result in self-check.
State Management: Tracks complex states including active turns, captured pieces, and “In Check” flags.
Custom UI: Hand-coded the board rendering and a dedicated “Promotion Handler” class for pawn upgrades.
Check out the code in the repo! 💻