C++ Strings, SFML Time: Player Input and HUD
Almost every game ever made will need to have some text on the screen – the score, the text of a character’s speech, and many other examples. Therefore, 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 inform the player of their remaining time and create a sense of urgency in the game.
We will cover the foallowing:
- Pausing and restarting the game
- C++ strings
- SFML Text and SFML Font
- Adding a score and a message
- Adding a time-bar
As we progress with this game over the next three chapters, the code will get longer and longer. So, now seems like a good time to think ahead and add a little bit more structure to our code. We will add this structure to give us the ability to pause and restart the game.