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 HUD, along with some much more advanced sound effects than we have used so far.