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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access