/snake

C++ Snake Game for a Udacity Nanodegree

Primary LanguageC++

CPPND: Capstone Snake Game

This program is an evolution of the Snake game starter. Instead of simply chasing after one fruit, the game now has four different kinds of fruit, each one with different effects and presentation.

  • Strawboring: Adds points and increases the snake's length
  • Raspboost: Increases the snake's speed
  • Aprinot: Adds points without increasing length
  • Clementime: Adds a large number of points, but slowly decays to nothing

In addition, the game now randomly generates wall blocks which slowly decay over time. When a wall decays totally, a new wall is created in a new location. If the snake hits a wall block, the game ends.

When you run the program, the game plays. Try not to die.

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

Essential:

  • A README is included
  • The README includes information about the project
  • The README indicates which points on the rubric have been met
  • The submission compiles and runs without errors

8/5 required points:

  • The submission uses a variety of control structures (functions, loops, ifs, and a switch statement are all found in game.cpp)
  • The project code is organized into classes with class attributes to hold the data, and class methods to perform tasks. (The fruit.h file contains several classes, and there is one in wall.h)
  • Classes encapsulate behavior. (fruit.h)
  • Classes follow an appropriate inheritance hierarchy. (fruit.h contains a base class and several child classes)
  • Overloaded functions allow the same function to operate on different parameters. (Overloaded constructors in fruit.h for the base Fruit class)
  • Class constructors utilize member initialization lists. (fruit.h, wall.h)
  • Classes use appropriate access specifiers for class members. (fruit.h, wall.h)
  • The project uses Object Oriented Programming techniques. (fruit.h, wall.h)