This project is a 3D Snake game written in C++ using the SFML graphics library. The goal was to create a 3D rendering without using any 3D library or game engine, relying solely on linear algebra to develop the game.
- 3D rendering of the game grid and the snake.
- Movement and teleportation of the snake in 3D space.
- Collision handling and snake growth.
- Rotation and orthographic projection to visualize the game in 3D.
- SFML (Simple and Fast Multimedia Library)
- Update the system and install dependencies (SFML 3, CMake, compiler):
sudo pacman -Syu sfml cmake gcc make git- Clone the project repository:
git clone https://github.com/Zyphorah/Snake3D.git- Change into the project directory:
cd Snake3D- Compile the project with CMake:
mkdir -p build
cd build
cmake ..
cmake --build .- Run the game:
./Snake3D- A: Move the snake to the right.
- D: Move the snake to the left.
- W: Move the snake forward (vertical axis).
- S: Move the snake backward (opposite of W).
- Q: Move the snake down (decrease altitude).
- E: Move the snake up (increase altitude).
The snake grows by one cube after moving four squares. Be careful not to collide with the snake's body while moving.
- Use the arrow keys to adjust the camera viewing angle.
