Skip to content

MahmoudSelmy/CppND-Capstone-Snake-Game

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CPPND: Capstone Snake Game Example

This is 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.

The Capstone Project gives you a chance to integrate what you've learned throughout this program. This project will become an important part of your portfolio to share with current and future colleagues and employers.

In this project, you can build your own C++ application or extend this Snake game, following the principles you have learned throughout this Nanodegree Program. This project will demonstrate that you can independently create applications using a wide range of C++ features.

New Features

  • Pause

    • Game can be paused/resumed by pressing ESC button.
  • Support 2 modes:

    • Game asks user before launch to choose one of them.

      • Default mode

      • Wall mode

  • Result message box shows when snake dies.

  • Random bouns periods:

    • There is random periods of bonus, it simply add +5 score to each food sample eaten during these periods "the food samples turns to green instead of yellow during the bonus period"

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 Points

  • Loops, Functions, I/O

    1. The project accepts user input and processes the input.
    2. The project demonstrates an understanding of C++ functions and control structures.
      • Project is structured into classes and functions
  • Object Oriented Programming

    1. The project uses Object Oriented Programming techniques.
      • Project contains classes [controller. game, renderer ,and snake]
    2. Classes use appropriate access specifiers for class members.
      • Any class uses public and private access specifiers to expose abstract API and hide the details.
      • Example : Game Class
        • Run(...) is public because it allows client to run the game. [line 18]
        • PlaceFood(...) is private because it's an implementation details.
    3. Class constructors utilize member initialization lists.
    4. Classes encapsulate behavior.
  • Memory Management

    1. The project makes use of references in function declarations.
    2. The project uses destructors appropriately.
    3. The project uses move semantics to move data, instead of copying it, where possible.
  • Concurrency

    1. The project uses multithreading.
    2. A mutex or lock is used in the project.

About

A 2D Snake game using C++ and SDL

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 77.5%
  • CMake 22.5%