A complete chess game in Python with its own AI engine you can play against.

The complete version of our chess tutorial: every rule (castling, en passant, promotion, repetition, 50-move rule...), an alpha-beta AI engine with 6 difficulty levels, clocks, PGN/FEN, drag-and-drop UI with arrows and animations, and perft-validated move generation.
Upgrades the free tutorial: How to Make a Chess Game with Pygame in Python
Everything the tutorial leaves as an exercise, done properly.
Negamax alpha-beta, PVS, transposition table, quiescence, null-move pruning and LMR.
Castling, en passant, promotion picker, checkmate, stalemate, threefold repetition, 50-move rule, insufficient material.
From Beginner (human-like mistakes) to Master, plus an opening book of 33 real lines.
Drag & drop or click, legal-move dots, animations, right-click arrows, eval bar.
3+2, 5+0, 10+0 and 15+10 time controls, a move list in SAN, and history browsing.
Save games as PGN, copy the FEN, start from any position, reuse the engine in your code.
Anti-aliased pieces drawn in code, 4 board themes, synthesized sounds.
Move generation checked against the standard perft positions; 19 tests in total.
Real, unedited screenshots of the game. Every pixel is drawn by the code you get.
The tutorial is great for learning the basics. This is the version you'd actually ship.
| Free tutorial | Chess Pro | |
|---|---|---|
| Rules | Basic moves | All rules incl. edge cases |
| Opponent | Another human | AI engine, 6 levels |
| Pieces | Needs downloaded images | Vector pieces drawn in code |
| Notation | — | SAN move list, PGN, FEN |
| Clocks | — | ✓ 4 time controls |
| Undo / hint / flip / arrows | — | ✓ |
| Opening book | — | ✓ 33 lines |
| Tests | — | Perft + rules + tactics (19) |
Clean, commented, modular Python. Here's the start of chess_pro/engine/search.py:
def _negamax(self, board: Board, depth: int, alpha: int, beta: int, ply: int) -> int:
self.nodes += 1
if self.nodes & 1023 == 0:
self._check_time()
if board.halfmove >= 100 or board.is_repetition(1):
return 0
# mate distance pruning
alpha = max(alpha, -MATE + ply)
beta = min(beta, MATE - ply - 1)
if alpha >= beta:
return alpha
The Game Dev Pro Pack includes Chess Pro plus our two other premium games, for $19 instead of $39.
What's in the pack?
Python 3.8 or newer and pygame (pip install pygame-ce, or classic pygame). It works on Windows, macOS and Linux. There are no image or sound files to download: everything is generated in code.
You're sent straight to your download page, and we email you the link too. The link keeps working, so you can re-download updated versions later. Lost it? Recover your downloads with your email.
If you've followed our free tutorial, yes. The code is split into small, commented modules, and the README walks through the architecture. It's the ideal next step after the tutorial.
Yes. You can modify it, learn from it, and ship your own games built on it, even commercially. The only thing you can't do is redistribute or resell the source code itself.
Email us within 14 days and we'll refund you. No questions asked.
$15 one-time. Instant download, free updates.