To compile the Snake game, you can use the following command:
g++ -o ./snake/snake ./snake/snake.cpp -lncurses
To start the Snake game, simply run the compiled executable:
./snake/snake
This guide will walk you through setting up the raylib library.
Clone the raylib repository from GitHub:
git clone https://github.com/raysan5/raylib.git
Change directory to the src
folder inside the cloned raylib repository:
cd ./raylib/src/
Build the raylib library using make
:
make
Copy the built libraylib.a
, raylib.h
, and raymath.h
files to your project directory named "ping-pong-raylib" (replace <your-path>
with the path to your project directory):
cp libraylib.a <your-path>/ping-pong-raylib
cp raylib.h <your-path>/ping-pong-raylib
cp raymath.h <your-path>/ping-pong-raylib
To compile the Ping Pong game using MacOS, you can use the following command:
g++ -framework CoreVideo -framework IOKit -framework Cocoa -framework GLUT -framework OpenGL -std=c++11 libraylib.a pingpong.cpp -o pingpong
To start the Ping Pong game, simply run the compiled executable:
./pingpong