Skip to content

Latest commit

 

History

History
62 lines (49 loc) · 3.06 KB

README.md

File metadata and controls

62 lines (49 loc) · 3.06 KB

CPPND: Capstone Option 2: Pacman game

This repo is for the Capstone project in the Udacity C++ Nanodegree Program.

This is a simple Pacman game implemented in C++.

In this game you (Pacman, the yellow block) shall only use keyboard arrows (Up, Down, Left and Rgiht) and your mission is to try to eat all food (purple blocks) without getting caught by any of game monsters (red blocks).

The game will end if Pacman gets caught by a monster of it Pacman eats all food.

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: ./Pacman.

Code Files Structure

  • controller.cpp - controller class soruce code.
  • controller.h - controller class header file.
  • game.cpp - game class soruce code.
  • game.h - game class header file.
  • main.cpp - file containing entry point of this application.
  • monster.cpp - monster class soruce code.
  • monster.h - monster class header file.
  • pacman.cpp - pacman class soruce code.
  • pacman.h - pacman class header file.
  • renderer.cpp - renderer class soruce code.
  • renderer.h - renderer class header file.

Rubric Points Met

Loops, Functions, I/O

1- The project demonstrates an understanding of C++ functions and control structures. Location: Almost in all code files.

Object Oriented Programming

2- The project uses Object Oriented Programming techniques. Location: Each cpp and header file encapsulate a certain class for example (monster.cpp and monster.h for monster class)

3- Classes use appropriate access specifiers for class members. Location: Same as above.

4- Class constructors utilize member initialization lists. Location: For example renderer.cpp(line 5).

Memory Management

5- The project makes use of references in function declarations. Location: for example in void Game::Run in controller.cpp(line 6).

6- The project uses smart pointers instead of raw pointers. Location: game.h(line 24).

Concurrency

7- The project uses multithreading. Location: monster.h(line 18).

8- A mutex or lock is used in the project. Location: monster.cpp(line 10), renderer.cpp(line 88).