Skip to content

dsardelic/CppND-Capstone-Snake-Game

 
 

Repository files navigation

CPPND: Capstone Snake Game

This game was developed from 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.


Basic game functionality has been extended as follows:

  • The actual game is wrapped in a menu loop. Upon running the executable, a menu is shown in the terminal. The user then selects the desired menu option.


  • Existing game mode (i.e. one blue-headed user-controlled snake) is deemed as Simple game mode. Now there is also an Advanced game mode, where the user-controlled snake and one magenta-headed autonomous snake go after the same food. The autonomous snake is driven using the A* algorithm, and avoids moving over board edges.


  • The game keeps track of top 10 high scores regardless of game mode (i.e. both modes share the same high score data).


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.

Program code highlights

This project uses multiple modern C++ features and paradigms:

CC Attribution-ShareAlike 4.0 International

Shield: CC BY-SA 4.0

This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

CC BY-SA 4.0

About

A 2D Snake game using C++ and SDL

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 84.7%
  • CMake 14.3%
  • C 1.0%