Chapter 3. C++ Strings, SFML Time, Player Input, and HUD

In this chapter we will spend around half the time learning how to manipulate text and display it on the screen, and the other half looking at timing and how a visual time bar can create a sense of urgency in the game.

We will cover the following topics:

  • Pausing and restarting the game
  • C++ strings
  • SFML Text and SFML font classes
  • Adding a HUD to Timber!!!
  • Adding a time bar to Timber!!!

Pausing and restarting the game

As we progress with this game over the next three chapters, the code will obviously get longer and longer. So, now it seems like a good time to think ahead and add a little bit more structure into our code. We will add this structure to give us the ability to pause and restart the game. ...

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.