This repo contains the Capstone project in the Udacity C++ Nanodegree Program. The code for this repo was inspired by this excellent StackOverflow post and set of responses and was developed to satisfy criterias in sections in Rubric. The solution was built on the project skeleton provided by Udacity.
The game strats by asking for a username and then a play window will appears with the snake and food. Keyboard is used to move the snake toward food. The map will change acordelly to the progression of the user inside the game. The game will also store the score and username after the game is closed. Here is a list with the maps present into the game.
food range | map |
---|---|
0 - 9 | |
10 - 19 | |
20 - 29 | |
30 - inf |
- cmake >= 3.7
- All OSes: click here for installation instructions
- make >= 4.1 (Linux, Mac), 3.81 (Windows)
- Linux: make is installed by default on most Linux distros
- Mac: install Xcode command line tools to get make
- Windows: Click here for installation instructions
- SDL2 >= 2.0
- All installation instructions can be found here
- Note that for Linux, an
apt
orapt-get
installation is preferred to building from source.
- gcc/g++ >= 5.4
- Linux: gcc / g++ is installed by default on most Linux distros
- Mac: same deal as make - install Xcode command line tools
- Windows: recommend using MinGW
- Clone this repo.
- Make a build directory in the top level directory:
mkdir build && cd build
- Compile:
cmake .. && make
- Run it:
./SnakeGame
.
- Loops, Functions --> The project code is OOP with the security mechanism in order to avoid fail states
- The project reads data from a file and process the data, or the program writes data to a file. --> Application read and write the file. (player.h)
- The project accepts user input and processes the input. -> user input in main.cpp
- The project uses Object Oriented Programming techniques. -> The project supports OOP
- Classes use appropriate access specifiers for class members. -> Members in player.h and map.h are explicitly specified as public, protected, or private.
- Class constructors utilize member initialization lists. -> Constructor of Map class
- Classes encapsulate behavior. -> Classes Map and Players