Skip to content

yjsung/CppND-Capstone-Snake-Game

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CPPND: Capstone Snake Game from Example code

This is a Stake game based on the starter code which is provided by Udacity C++ Udacity C++ Nanodegree Program. (base repo: https://github.com/udacity/CppND-Capstone-Snake-Game)

Rudbic Points

  • The project uses Object Oriented Programming techniques.

    • Classes for controller/game/renderer/snake is used in the program.
  • Class constructors utilize member initialization lists.

    • Initialization list is used in game/renderer/snake class constructor.
  • Templates generalize functions in the project.

    • Applied Templates in message queue in renderer class.
  • The project uses destructors appropriately.

    • Class destructor is well defined in renderer class.
  • The project uses multithreading.

    • There are 2 thread : main and thread for renderer.
  • A mutex or lock is used in the project. A condition variable is used in the project.

    • In renderer class, MessageQueue concept is applied. To apply MessageQueue concept, mutex and condition variable are used.

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.

Game Rule

  1. If snake eat the food, snake's body will grow and you'll get 1 point.
  2. Every time when snake eat the food, snake's speed will be faster.
  3. If snake hit the wall or itself then game is over.

About

A 2D Snake game using C++ and SDL

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 36.1%
  • Makefile 28.5%
  • CMake 19.7%
  • C 15.7%