Summary
In this chapter, we learned about strings, SFML Text
, and SFML Font
. Between them, they enabled us to draw text to the screen, which provided the player with a HUD. We also used sstream
, which allows us to concatenate strings and other variables to display the score.
We explored the SFML RectangleShape
class, which does exactly what its name suggests. We used an object of type RectangleShape
and some carefully planned variables to draw a time-bar that displays to the player how much time they have left. Once we have implemented chopping and moving branches that can squash the player, the time-bar will create tension and urgency.
Next, we are going to learn about a whole range of new C++ features, including loops, arrays, switching, enumerations, and functions. This will enable us to move the tree branches, keep track of their locations, and squash the player.