This project is about chess game in 3D mode. Chess is a two-player strategy board game on a checkered board with 8x8 grid dimension. There is two player on each game which the first player as White and the second player as Black.
To use this repository, you will need:
- C++
- FreeGLUT
- Clone this repository
git clone https://github.com/stevenalbert/3d-chess-opengl
- Compile C++ source code files
- Run the executable
Notes: To run this program please put the executable file and model directory in the same directory. This program has only been tested on Windows and Linux.
# build
mkdir -p bin && g++ main.cpp Model.cpp Chess/*.cpp `pkgconf --libs glut gl glu` -o bin/3d-chess-opengl
# run
bin/3d-chess-opengl- Each player started with 16 pieces (2
Rooks, 2Knights, 2Bishops, 1Queen, 1King, and 8Pawns) on respective side. - First turn is for
Whitepiece and next turn is forBlackpiece. - Other rules can be read in Rules of Chess - Wikipedia
Check- WhenKingis under immediate attack of opponent's pieceCheckmate-Checkstate without valid move left for the player to make theKingun-Check-edStalemate- Not inCheckstate but can't move other than move to theCheckitself (not implemented)
Win- The player who givesCheckmateto opponentLose- The player who gotCheckmateDraw- There is no winner (not implemented)
| Key | Action |
|---|---|
N |
Start new game |
W |
Move cursor forward 1 step |
A |
Move cursor left 1 step |
S |
Move cursor backward 1 step |
D |
Move cursor right 1 step |
Space |
Select piece Move piece Cancel move |
O |
Approve start new game |
X |
Close game after checkmateCancel start new game |
Q |
Promote to Queen |
R |
Promote to Rook |
B |
Promote to Bishop |
K |
Promote to Knight |
