Skip to content

rituuu001/Chess

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Chess Game (Python + Pygame)

A simple chess game built with Python and Pygame, using object-oriented programming principles.

Overview

This project is a 2-player chess game implementation focused on:

  • Core chess mechanics
  • OOP-based architecture
  • Interactive graphical board using Pygame

It is a good learning project for understanding game loops, state management, and clean class design in Python.

Features

  • Standard 8x8 chessboard interface
  • Turn-based gameplay
  • Valid piece movement rules
  • Check and checkmate detection
  • Castling
  • En passant
  • Pawn promotion
  • Object-oriented code structure
  • Pygame-based rendering and input handling

Tech Stack

  • Language: Python
  • Library: Pygame
  • Programming style: Object-Oriented Programming (OOP)

Installation and Setup

1. Clone the repository

git clone https://github.com/rituuu001/Chess.git
cd Chess

2. Create and activate a virtual environment (recommended)

Windows (PowerShell):

python -m venv venv
venv\Scripts\activate

macOS/Linux:

python3 -m venv venv
source venv/bin/activate

3. Install dependencies

pip install pygame

4. Run the game

python main.py

How to Play

  • Start the game window.
  • Players take turns moving pieces.
  • The game enforces chess rules, including special moves and check/checkmate conditions.

Project Structure

Chess/
├── assets/              # Images
├── board.py                 
├── game.py
├── gui.py               #GUI          
└── README.md

OOP Design

Typical class responsibilities in this project:

  • Game: controls game loop and game state
  • Board: manages board state and piece positions
  • Piece base class: shared behavior for all pieces
  • Piece subclasses (Pawn, Rook, Knight, etc.): movement logic and rules

Remaining Improvements

  • AI opponent
  • Move history and undo move support

About

A simple chess game built in python using pygame

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages