Running the game
Now our cameras are drawing the VertexArray
to the screen and we can delete the extra line of code we added temporarily in the main
function. Delete the following code from Run.cpp
:
…
// Temporary code until next chapter
window.draw(canvas, factory.m_Texture);
…
Now we can run the game and see the cameras in action.
Figure 17.2: Cameras in action
In the preceding image, you can see the player correctly positioned and scaled.
Also, if you scroll the mouse wheel, you can see the mini map zooming in and out, although there isn’t much to see in it yet.
In the next chapter, we will add the platforms, and then after that, in the same chapter, we can add animation and keyboard controls to the player. Remember, the InputReceiver
instance in the PlayerUpdate
class is already receiving all the events; we just need to respond to them.