Adding Castling, Pawn Promotion and En Passant to Chess in Python!

Adding Castling, Pawn Promotion and En Passant to Chess in Python!

LeMaster Tech
LeMaster Tech
30 Video Views·Apr 20, 2025

Here is Chess Part One:
https://www.youtube.com/watch?v=X-e0jk4I938&t=138s

Here is the code and assets for both parts!
https://github.com/plemaster01/pygameChess

Lots of People Enjoyed Our Original Chess Program But Wanted En Passant, Castling and Pawn Promotion Added So Here It Is! Thanks for watching!

Consider becoming a channel super supporter at my Patreon!
https://www.patreon.com/LeMasterTech

Timestamps:
00:00:00 Intro, Showcase and Shoutouts
00:05:00 Restructuring The Program, Moving Variables into Separate .py file
00:07:57 Fixing Pawn Two Space Ahead Bug
00:09:39 En Passant Checking If Pawn Moved Two Spaces
00:16:10 Adding En Passant as Valid Pawn Move!
00:24:17 Capturing an En Passant Piece
00:28:22 Checking for Pawn Promotion Locations
00:34:35 Draw Pawn Promotion Menu
00:44:30 Select and Promote Pawn When Clicked
00:48:55 Track If Pieces Have Moved For Castling
00:57:01 Check If Castling Moves are Valid
01:13:30 Draw Valid Castling Moves on Screen!
01:22:15 Select Castling Moves and Change Rook and King Positions
01:31:28 Outro and Thank You!