GithubHelp home page GithubHelp logo

mo3sw / cppnd-capstone-ping-pong-game Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 214 KB

This project is the Capstone project for Udacity's C++ NanoDegree program. I have developed from scratch a ping pong game using SDL library and the C++ programming language.

CMake 14.58% C 15.92% C++ 35.80% Makefile 33.70%

cppnd-capstone-ping-pong-game's Introduction

CppND-Capstone-Ping-Pong-Game

This project is the Capstone project for Udacity's C++ NanoDegree program Udacity C++ Nanodegree Program.

The project is a Ping Pong game between two players. Once you follow the instructions below to compile, build, and run the project, you can start playing imidiately. The game is a black screen with two pallets on the each side of the screen which the player can control and a ball starting in the middle which will start bouncing between the players. Once the ball reaches one of the side it considered as a goal and it will go back to the middle and start again.

Class Diagram

Dependencies for Running Locally

Basic Build Instructions

  1. Clone this repo.
  2. Go to the 'build' directory: cd build
  3. Compile: cmake .. && make
  4. Run it: ./PingPong.

Capstone Project Rubic Points

Compileing and testing

  • The project code must compile and run without errors

Loops, Functions, I/O

  • A variety of control structures are used in the project. The project code is clearly organized into functions.
  • The project reads data from an external file or writes data to a file as part of the necessary operation of the program.
  • The project accepts input from a user as part of the necessary operation of the program.

Object Oriented Programming

  • The project code is organized into classes with class attributes to hold the data, and class methods to perform tasks.
  • All class data members are explicitly specified as public, protected, or private.
  • All class members that are set to argument values are initialized through member initialization lists.
  • 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.
  • Appropriate data and functions are grouped into classes. Member data that is subject to an invariant is hidden from the user. State is accessed via member functions.
  • Inheritance hierarchies are logical. Composition is used instead of inheritance when appropriate. Abstract classes are composed of pure virtual functions. Override functions are specified.
  • One function is overloaded with different signatures for the same function name.
  • One member function in an inherited class overrides a virtual base class member function.
  • One function is declared with a template that allows it to accept a generic parameter.

Memory Management

  • At least two variables are defined as references, or two functions use pass-by-reference in the project code.
  • At least one class that uses unmanaged dynamically allocated memory, along with any class that otherwise needs to modify state upon the termination of an object, uses a destructor.
  • The project follows the Resource Acquisition Is Initialization pattern where appropriate, by allocating objects at compile-time, initializing objects when they are declared, and utilizing scope to ensure their automatic destruction.
  • For all classes, if any one of the copy constructor, copy assignment operator, move constructor, move assignment operator, and destructor are defined, then all of these functions are defined.
  • For classes with move constructors, the project returns objects of that class by value, and relies on the move constructor, instead of copying the object.
  • The project uses at least one smart pointer: unique_ptr, shared_ptr, or weak_ptr. The project does not use raw pointers.

Concurrency

  • The project uses multiple threads in the execution.
  • A promise and future is used to pass data from a worker thread to a parent thread in the project code.
  • A mutex or lock (e.g. std::lock_guard or `std::unique_lock) is used to protect data that is shared across multiple threads in the project code.
  • A std::condition_variable is used in the project code to synchronize thread execution.

cppnd-capstone-ping-pong-game's People

Contributors

mo3sw 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.