March 2016
Beginner to intermediate
340 pages
6h 51m
English
We now have a framework to load and render game objects. But, we don't have any way to move our ship! The good news is that we already wrote an input class for RoboRacer2D, and we can reuse that code here.
Earlier in the chapter, I had you copy the Input class from RoboRacer2D into the source folder for SpaceRacer3D. Now, we have to simply wire it into our game code.
Open SpaceRacer3D. First, we need to include the input header. Add the following line of code to the headers:
#include "Input.h"
We also need to create a global pointer to manage the Input class. Add the following line just below the model pointers:
Input* m_input;
Next, we need to create an instance of the Input class. Add the following line of code to ...
Read now
Unlock full access