This is a starter repo for 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.
In this project I extended a basic version of the Snake Game with additional Features by following the principles I learned throughout the C++ Nanodegree Program (see Rubric Points).
- Pause/Exit
- The game now can be paused/resumed using
ESC
and exit using theq
button
- The game now can be paused/resumed using
- Power Food
- Special food types prevent increasing of the snakes velocity
- Random Obstacles
- The user can increase the game difficulty by speciying a number of obstacles. These are randomly appearing and lead to a death at collision
- 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
.
- The project demonstrates an understanding of C++ functions and control structures.
- The project accepts user input and processes the input.
- The project code is organized into classes with class attributes to hold the data, and class methods to perform tasks.
- All class data members are explicitly specified as public, protected, or private.
- All class member functions document their effects, either through function names, comments, or formal documentation. Member functions do not change program state in undocumented ways.
- The project makes use of references in function declarations.
- Due to time constraints, these have not been integrated at this stage.
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.