A simple implementation of chess in raylib.
Although the project source files have .cpp extensions the project is mainly written in plain c, apart from the use of vectors and some algorithms, so the structure is more c-like (which would exlpain no oop definition of the game logic or other c++ norms).
- Git:
- Windows:
winget install git.git
- Linux(ubuntu-based):
sudo apt install git
- Windows:
- g++:
- Windows: Discussed in
USAGE - WINDOWS
section below. - Linux(ubuntu-based):
sudo apt install build-essential
- Windows: Discussed in
- raylib:
- Windows: Discussed in
USAGE - WINDOWS
section below. - Linux: https://github.com/raysan5/raylib?tab=readme-ov-file#build-and-installation
- Windows: Discussed in
git clone https://github.com/GiorgosAthanasopoulos/raylib-chess
cd raylib-chess
cc nobuild.c -o nobuild
./nobuild
- Lets call the directory that we will use to clone the repositories in
$PROJECTS
. cd $PROJECTS
- Start by cloning raylib-chess (the actual game):
git clone https://github.com/giorgosathanasopoulos/raylib-chess
- We need a compiler - lets use W64Devkit:
- Download the w64devkit zip from the W64Devkit Releases page.
- Extract the folder in $PROJECTS.
- So far the $PROJECTS directory should contain:
raylib-chess
andw64devkit
sub-directories.
- Finally we need the raylib library. To make everything easy we will use a raylib game template that comes with makefiles out of the box (and that will automatically download raylib):
git clone https://github.com/raylib-extras/game-premake
- That's all for the dependencies. Our
$PROJECTS
directory should containraylib-chess
,w64devkit
andgame-premake
sub-directories. Lets configure and build/run our project: - Run the executable
$PROJECTS/w64devkit/w64devkit/w64devkit.exe
In the new terminal run: cd $PROJECTS/game-premake
premake-mingw.bat
(This will download raylib for us - along with creating a makefile for our project). Now lets copy raylib-chess in the game-premake src directory:rm ./game/src/*
cp ../raylib-chess/src/* ./game/src/
cp ../raylib-chess/_build/game-premake.make ./_build/
make
(You should see the raylib library being compiled),mkdir assets
cp ../raylib-chess/assets/* ./assets/
_bin/Debug/game-premake.exe