This is a game pong-inspired called Paredon, this was coded for the Capstone project in the Udacity C++ Nanodegree Program. The code for this repo was inspired by this excellent StackOverflow post and set of responses, then modified to get a new game.
The object of the game is to try to keep the ball within the playing area for as long as possible. Three walls help from the top, left and right sides. Underneath a movable platform is used to bounce the ball into the playing area. This platform is moved using the left and right keys of the keyboard. The game ends when the ball leaves the area.
- cmake >= 3.7
- All OSes: click here for installation instructions
- make >= 4.1 (Linux, Mac), 3.81 (Windows)
- Linux: make is installed by default on most Linux distros
- Mac: install Xcode command line tools to get make
- Windows: Click here for installation instructions
- SDL2 >= 2.0
- All installation instructions can be found here
- Note that for Linux, an
apt
orapt-get
installation is preferred to building from source.
- gcc/g++ >= 5.4
- Linux: gcc / g++ is installed by default on most Linux distros
- Mac: same deal as make - install Xcode command line tools
- Windows: recommend using MinGW
- Clone this repo.
- Make a build directory in the top level directory:
mkdir build && cd build
- Compile:
cmake .. && make
- Run it:
./paredon
.
This capstone project is based in this rubric completion. These are the details.
You are seing it right now. It has detailed instructions for building/running, decribe the project and the rubric points addressed.
Source code was compiled and tested in a local machine using g++ 7.5.0 in Ubuntu 18.04 and in the Udacity Workspace
- A variety of control structures was used in this project (for, while, if, switch).
- The project reads and writes data to a file as a score logging.
- The project accepts input from a user as part of the necessary operation of the program. As player name and arrow keys for player platform moving.
- 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.
- One member function in an inherited class overrides a virtual base class member function.
- At least two variables are defined as references, or two functions use pass-by-reference in the project code.
- 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.
- The project uses at least one smart pointer: unique_ptr, shared_ptr, or weak_ptr. The project does not use raw pointers.
- The project uses multiple threads in the execution.
- 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.