It is a personal project I created while learning about SDL and C++.
After learning theory, I wanted to learn by praticing !
You can clone the repository and run it on any IDE or download the snake.zip file (it is windows only) and open the executable 2DSnakeSDL2.exe file.
I only built and ran it on Windows 10, but SDL2 is multiplatform, so you should be able to get it to build on anything so long as you understand your local OS's build system.
It is a snake clone where I wanted to create a game without a game engine with C++ and SDL2. I created all the sprites for the game.. Musics are royalty-free.
Use the arrows to move around. You have to eat apples to make the snake grow. Eat as many apples as possible to reach a high rank!
Take care of your body and walls, or you'll die.
Have fun !
- I considered that all the code could be done in the
main.cppfile which, in a more complicated game, would be a bad idea, but for something simple breaking everything apart would make it harder to understand. - You can find it in the
srcfolder. - All the resources used are located inside
Resourcesfolder. - You can find an executable in the
Snake.zipfolder.
I have used the following librairies :
SDL2for user inputs, window and renderer.SDL2_imagefor sprites and textures inside the game.SDL2_mixerfor the sound effect.SDL2_ttffor the fonts used inside the game.