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.
- 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
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 inwall.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 baseFruit
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
)