Programming a Chess Game in C# | Part 3 - Pieces & The Board

Опубликовано: 27 Март 2026
на канале: OttoBotCode
18,652
273

Learn how to program a Chess game in C#!

Welcome to part 3 of my C# Chess tutorial.
This time, we write classes for all the chess piece (pawn, bishop, rook, knight, king & queen). We also start working on a Board class which stores all pieces and their positions. Finally, we add a GameState class which encapsulates the state of the game. With all of this in place, we can draw the board on the screen!

Assets:
https://ottobotcode.com/chess/ChessAs...

Source code is available here:
  / 78701  

Chapters:
0:00 - Plan
0:15 - PieceType Enum
1:20 - Piece Base Class
3:30 - Pawn Class
5:40 - Bishop Class
7:13 - Knight, King, Queen & Rook
7:47 - Board Class
8:42 - Indexers
10:43 - Initial Board Setup
13:37 - IsInside & IsEmpty
14:50 - GameState Class