A simple 2D endless Car racing game developed using C++ and SDL.
This repository is for the Capstone project required for completing Udacity C++ Nanodegree Program. The code is based on the Capstone Snake Game Example provided by Udacity.
This project fulfills the below Rubric points:
- A README with instructions is included with the project
- Yes
- The README indicates which project is chosen
- Yes
- The README includes information about each rubric point addressed
- Yes.
- The submission must compile and run
- Yes, Program compiles and runs sucessfully.
-
The project demonstrates an understanding of C++ functions and control structures
- Project uses if-else, switch , while loop, for loop, system defined, and user defined functions.
-
The project accepts user input and processes the input
- Project accepts user input to move vehicle left and right.
- The project uses Object Oriented Programming techniques
- Yes.
- Classes use appropriate access specifiers for class members
- Yes.
- Class constructors utilize member initialization lists
- Yes: please refer code e.g.
game.cpp
ortraffic_generator.cpp
.
- Yes: please refer code e.g.
- Classes encapsulate behavior
- Yes: e.g.
TrafficGenerator::GenerateVehicle()
intrafficgenerator.h
,Vehicle::CheckCollision()
invehicle.h
, etc.
- Yes: e.g.
- Classes follow an appropriate inheritance hierarchy
- Yes, Player, Vehicle, and Track inherits from GameObject class.
- The project makes use of references in function declarations
- Yes.
- The project uses destructors appropriately
- Yes, Project uses smart pointers.
- The project follows the Rule of 5
- No: smart pointers are used instead.
- The project uses smart pointers instead of raw pointers
- Yes, shared smart pointers are used.
- The project does not uses multithreading.
- 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 repository.
- Make a build directory in the top level directory:
mkdir build && cd build
- Compile:
cmake .. && make
- Run it:
./RoadRacing
.