Skip to content

pukkinming/CppND-Capstone-Snake-Game

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CPPND: Capstone Snake Game

This is the final Capstone project of the Udacity C++ Nanodegree Program. The code for this repo was inspired by this excellent StackOverflow post and set of responses.

Game Screens


Game Features

  1. There are boosters marked by 🚀 which will speed up the snake's speed.
  2. New boosters will be randomly placed in the game after you eat any of them.
  3. Beware of obstacles.
  4. Parameters such as number of obstacles and boosters can be configured from gameConfig/config.txt file.
  5. A starting screen has been added.
  6. The game can be reset in the starting screen.
  7. The game can be paused if you press Esc.

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.

Project Specification

Compiling and Testing

  • The submission must compile and run.

Loops, Functions, I/O

  • The project demonstrates an understanding of C++ functions and control structures.
    • The code starts from main.cpp and uses functions along the way.
  • The project reads data from a file and process the data, or the program writes data to a file.
    • It reads data from the config file (header, cpp).
  • The project accepts user input and processes the input.
    • It has a welcoming page and allows the player to choose to play, reset, or quit the game (welcoming page).

Object Oriented Programming

  • The project uses Object Oriented Programming techniques.
    • Please visit the src folder and take a look. The project code is built on objects such as controller, snake, obstacles, and renderer.
  • Classes use appropriate access specifiers for class members.
    • Please visit the src folder and take a look.
  • Class constructors utilize member initialization lists.
  • Classes encapsulate behavior.
  • Classes follow an appropriate inheritance hierarchy.

Memory Management

  • The project makes use of references in function declarations.
  • The project uses destructors appropriately.
  • The project uses smart pointers instead of raw pointers.

About

A C++ demo project

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published