This is a simple snake game implemented in C++ using OpenGL. The game allows players to control a snake, moving it around the screen to eat food and grow longer. However, players must avoid collisions with barriers and their own snake body. The game features multiple levels and keeps track of the player's score.
- Use the arrow keys (up, down, left, right) or the keys 'w', 'a', 's', 'd' to control the movement of the snake.
- Press 'p' to start the game or resume after a game over.
- Press 'm' to go back to the main menu.
- Press 'h' to view the high score.
- Press 'H' to view game history.
- Press '1', '2', '3', '4', or '5' to manually switch levels.
- Press 'q' or 'ESC' to quit the game.
- 5 levels with increasing difficulty.
- Dynamic food generation with different types of food.
- High score tracking.
- Game history tracking.
- Barrier obstacles to avoid collision.
- Smooth animation and gameplay.
I made this on Ubuntu so I only know how to run it there:
-
Clone this repository to your local machine by clicking on code and downloading the zip folder.
-
Install GCC (g++) compiler:
sudo apt-get install g++
- Install Libraries like OpenGL and glut
sudo apt-get install freeglut3-dev glew-utils libglew-dev libfreeimage-dev
- Run Make File To run this project, you must compile it first. To do so, go to the root of the project folder via terminal and run the following:
make
- Run the executable file generated, 'gamerelease' , by clicking on it.
This game was solely developed by me (Aleena Zahra) for my first semester final project.
- The game is optimized for a canvas size of 900x900 pixels.
- Adjustments can be made to the code for customization or further development.
- For any issues or feedback, please open an issue on GitHub.
Enjoy playing the game! 🐍🎮