Nibbler
made with C++
Technical details
- Client
Epitech
- Prog. Languages
C++
- Libraries
OpenGL / SDL
- Plateforms
Linux
- Date
March 2015
Project description
I made this game in C++ for an Epitech project. This game is inspired by the game “Snake”.
1. Technical constraint
The school imposed the following constraint: “The project must be able to compile with 3 different
graphic libraries.” This constraint helps students to separate the core of the game and the
graphics functions.
I chose OpenGL so that I can display 3D graphics, SDL so that I can display 2D graphics and ASCII
so that I can also play in the computer terminal.
2. About the game
The goal of the game is to get the highest score before the end of the game.
The game ends when the snake collides with an obstacle or with his tail.
The snake continuously moves forward, but the player can rotate the head of the snake to the left
or to the right.
There is a fruit on the map. The snake must eat the fruit to get points. Once the fruit is eaten
by the snake, it reappears somewhere else on the map and the length of the snake tail is increased
by 1 unit.
Obstacles appears randomly on the map every time the fruit is eaten.
With the OpenGL Library, the snake is made of a truncated pyramid (head) and cuboids (tail). The
fruit is an apple made of a cylinder (stem) and a sphere. Obstacles are made of cubes.
With the SDL Library, the snake is made of a Pokémon character (head) and Poké-balls (tail). The
fruit is made of multiple Pokémons. Obstacles are made of mountains.
With the ASCII, the snake is made of "^/" (head) and "x" (tail). The fruit is made of "3" and
obstacles of "@".