/CppND-Capstone-Snake-Game

A 2D Snake game using C++ and SDL

Primary LanguageC++Creative Commons Attribution Share Alike 4.0 InternationalCC-BY-SA-4.0

CPPND: Capstone Snake Game Example

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.

Description

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

Dependencies for Running Locally

Basic Build Instructions

  1. Clone this repo.
  2. Make a build directory in the top level directory: mkdir build && cd build
  3. Compile: cmake .. && make
  4. Run it: ./SnakeGame.

Rubric

  1. Loops, Functions --> The project code is OOP with the security mechanism in order to avoid fail states
  2. 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)
  3. The project accepts user input and processes the input. -> user input in main.cpp
  4. The project uses Object Oriented Programming techniques. -> The project supports OOP
  5. Classes use appropriate access specifiers for class members. -> Members in player.h and map.h are explicitly specified as public, protected, or private.
  6. Class constructors utilize member initialization lists. -> Constructor of Map class
  7. Classes encapsulate behavior. -> Classes Map and Players