Summary

There was quite a lot of code in this chapter. We learned how to read from a file and convert strings of text into char and then int. Once we had a two-dimensional array of int, we were able to populate a VertexArray to actually show the level on the screen. We then used exactly the same two-dimensional array of int to implement collision detection. We used rectangle intersection, just as we did in the Zombie Arena project, although this time, for more precision, we gave each character four collision zones, one each to represent their head, feet, and their left and right sides.

Now that the game is totally playable, we need to represent the state of the game (score and time) on the screen. In the following chapter, we will implement the ...

Get Beginning C++ Game Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.