Coder Social home page Coder Social logo

cpp-capstone's Introduction

CPPND: Capstone Pacman Game

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

This this a Pacman-like game. The player need to eat foods to earn score, while avoid the attack from ghost. The player can adjust the game difficulty at start.

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.

How to play

In order to play this game, you should build and run the program. After that, the program will ask you to select the difficulty:

Welcome to Pacman Game. Please choose a difficulty:

  1. Easy
  2. Normal (Default)
  3. Difficult
  4. Customization

Two difficulty will affect two different things in the game:

  • Number of food: Each round there are several (1-10) pieces of food will be placed randomly. After eat them all, the player will enter into a new round. New pieces of food and a new ghost will show up
  • Speed of ghost (0.1-2): The ghost will run randomly in a constant speed, the player should avoid touch the ghost.

You can choose the difficulty from easy, normal or difficult. Otherwise, you can also customize two variables shown above by youself.

After decide the difficulty, the game start, as:

image-20210809220725512

In the game screen, the blue square is the player, yellow squares are food pieces, red rectangular is the ghost.

When the player touch the ghost, the game end:

image-20210809220942392

The player has eaten by a ghost, the it turns to red.

Project Specification

Based on the rubric, the following specification has been satisfied:

README

Done Criteria Meets Specifications
A README with instructions is included with the project The README is included with the project and has instructions for building/running the project. If any additional libraries are needed to run the project, these are indicated with cross-platform installation instructions. You can submit your writeup as markdown or pdf.
The README indicates which project is chosen. The README describes the project you have built. The README also indicates the file and class structure, along with the expected behavior or output of the program.
The README includes information about each rubric point addressed. The README indicates which rubric points are addressed. The README also indicates where in the code (i.e. files and line numbers) that the rubric points are addressed.

Compiling and Testing

Done Criteria Meets Specifications
The submission must compile and run. The project code must compile and run without errors. We strongly recommend using cmake and make, as provided in the starter repos. If you choose another build system, the code must compile on any reviewer platform.

Loops, Functions, I/O

Done Criteria Meets Specifications
The project demonstrates an understanding of C++ functions and control structures. A variety of control structures are used in the project.
The project accepts user input and processes the input. The project accepts input from a user as part of the necessary operation of the program.

Object Oriented Programming

Done Criteria Meets Specifications Notes
The project uses Object Oriented Programming techniques. The project code is organized into classes with class attributes to hold the data, and class methods to perform tasks.
Classes use appropriate access specifiers for class members. All class data members are explicitly specified as public, protected, or private.
Class constructors utilize member initialization lists. All class members that are set to argument values are initialized through member initialization lists.
Classes abstract implementation details from their interfaces. All class member functions document their effects, either through function names, comments, or formal documentation. Member functions do not change program state in undocumented ways.
Classes follow an appropriate inheritance hierarchy. Inheritance hierarchies are logical. Composition is used instead of inheritance when appropriate. Abstract classes are composed of pure virtual functions. Override functions are specified. The ghost and Pacman classes are the inheritance of human class

Memory Management

Done Criteria Meets Specifications
The project makes use of references in function declarations. At least two variables are defined as references, or two functions use pass-by-reference in the project code.

cpp-capstone's People

Contributors

hanwang729 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.