Running the game
If we run the game at this point, we still get the blank gray screen. This is because we are not drawing our VertexArray
. In the next chapter, we will see how to draw the VertexArray
twice to create a regular view as well as a mini map. We will achieve this by coding some classes to represent cameras or views of our game. For now, just add this highlighted line of code to the main
function in Run.cpp
just before the call to window.display
:
// Temporary code until next chapter
window.draw(canvas, factory.m_Texture);
// Show the new frame.
window.display();
Now, if you run the game and look closely, very closely, in the top-left corner of the screen, you can just about see a tiny, static player graphic. I haven’t provided a screenshot because it is so tiny. Read on for a solution. You will also have noticed the short piece of music playing on a loop. If you prefer to work in silence while you test your code going forward, just delete these two lines...