Back to Projects

Snake with SDL2

This project is a remake of the old Snake game, written in C++ and based on SDL2.

I have worked on this project with another person at Gaming Campus (our school) for a month. The primary goals of this project were to make us discover object-oriented programming (OOP) through the C++ language, and make us learn some of the basic Linux shell commands.

Bonuses galore!

Initially, adding textures to our game was purely optional. The main goal was to get used to the C++ language and object oriented programming, and having a working snake game at the end of the month.
Having been a self-taught C++ programmer for four years, and the game's specifications allowing bonus points to be earned, I decided to push the bonuses to the absolute limit : score display and saving, textures on everything, main menu and gameover screen, different types of fruits, etc...
For the textures, I actually modeled the background, snake and fruits in three-dimensions, and rendered those models on flat textures which we used in the final game.

Gameplay

The game provides three different fruit types :

Additionally, the highscore is saved in a simple text file, and loaded at the beginning of the game.

Gallery

Click an image to enlarge.

Index