Go to file
2026-06-06 14:24:08 +02:00
pieces changed resolution of pieces to be 100x100 pixels 2026-06-06 14:21:09 +02:00
.gitignore changed color for board and added black and white rook .pngs 2026-06-03 15:44:07 +02:00
board.py changed color for board and added black and white rook .pngs 2026-06-03 15:44:07 +02:00
main.py hardcoded rendering of black rook and knight 2026-06-06 14:24:08 +02:00
position.py . 2026-06-04 16:00:27 +02:00
readme.md Update readme.md 2026-05-17 20:04:45 +02:00
renderPieces.py added file to render pieces on board 2026-06-04 16:43:14 +02:00

Chess Game

A Python chess board renderer built with Pygame. Renders a classic 8x8 chessboard with alternating black and white squares at 60 FPS.

Requirements

  • Python 3.x
  • Pygame

Confirmed working on: Arch Linux (omarchy), Windows 11

Installation

Python needs to be installed.

Then install Pygame by running this in your terminal:

pip install pygame

If you're on Linux and pip doesn't work, try pip3 instead. On Arch you can also install it through pacman:

sudo pacman -S python-pygame

Once that's done, just run the game with:

python main.py

How It Works

The six chess piece types are defined as named variables at the top of main.py, and two lists represent the standard starting rows — the back rank and the pawn row.

The board itself is an 800x800 window split into a 8x8 grid of 100x100 pixel squares. Each row alternates which color starts first, giving you the classic chessboard pattern. The whole board is redrawn every frame, capped at 60 FPS using Pygame's clock.

The main loop handles three things: listening for the quit event, clearing and redrawing the board each frame, and flipping the display buffer to show the result.

Project Structure

chess-game/
└── pieces
    └── pieces.png (multiple)
├── board.py
├── main.py
└── README.md

Sources