Skip to content

mtquadros/Snake-Game

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Snake Game

Project description

This project is a 2D game written in C++ with SDL library for graphic rendering. It's called Snake Game. The goal is to guide the snake to eat the apple. Use direction buttons to set the direction (left, right, up, down) the snake is going to. Each time the snake eats the food his body grows up and score is incremented. If the snake eats his own body the game ends. The starter code can be found at the repo (https://github.com/udacity/CppND_Capstone_Snake_Game).

Rubric points addressed

Memory Management

  • 1st requirement: The project makes use of references in function declarations
    • files: renderer.h (line 58); renderer.cpp (line 115)
  • 6th requirement: The project uses smart pointers instead of raw pointers
    • files: renderer.h (lines 62 to 73); renderer.cpp (lines 22 to 63)

Object Oriented Programming

  • 7th requirement: Overloaded functions allow the same function to operate on different parameters
    • files: renderer.h (lines 17 to 45)
  • 5th requirement: Classes encapsulate behaviour
    • files: snake.cpp (lines 5 to 150); snake.h (lines 31 to 47)

Loops, Functions, I/O

  • 2th requirement: The project reads data from an external file
    • file: renderer.cpp (lines 44 to 47)

Structure and output of the program

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.

About

No description or website provided.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors