Summary

In this chapter we learnt 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 the type RectangleShape, and some carefully planned variables, to draw a time bar that visually displays how much time a player has 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, ...

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.