Archives

SFML Chess Game

I used SFML to program a 2D chess game, using the chess set modelled in Maya to create the sprites.
The piece images are placed automatically in positions determined by reading a ‘FEN’ string (Forsyth-Edwards Notation). The FEN string for the start of the game would be “rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR”.
Lower-case letters are black pieces, upper-case are white pieces. ‘/’ represents a new row, and numbers represent empty squares. So ‘ppp4p’ would represent a row with three pawns, then four empty squares, then a single pawn.
The FEN string for the second image would be this:
“2r3k1/p4p1p/2r3p1/p1bp4/b4B2/P1R1PN2/5PPP/1R2K3”.


Piece Capture

Pawn Promotion

En Passant

Chess Set

This chess model was made in my spare time in Autodesk Maya, based on an actual chess set I own. I later used this to make 2D sprites for a chess game I made in SFML.