Here, we will learn how to display text messages on the screen and implement the restart functionality. The messages give a visual cue to the user about the state of the game and what action he is supposed to take. The restart functionality will allow the user to restart the game from any point.
We have created the logic and different game states, but we haven't shown the user whether he has won or lost. Also, we don't show which state he is in and what action he is supposed to take. In this section, we are going to learn how to display text. LibGDX has a class called
BitmapFont that enables us to draw text on the screen.
We are going to create a class called
TextManager, which is going to ...