Chapter 6. Managing and Displaying Information

The gameplay mechanics are in place, we've added some nice visual effects, and our game is starting to look great, but there is still an important element missing; players of our game have no indication of how they are progressing. We need to let our players know how well (or badly) they are doing, otherwise there will be no incentive for them to continue playing the game!

There are many different pieces of information that might be useful to a player during gameplay, but we need to be careful not to overwhelm them, otherwise they'll be distracted from the game. Currently, we are keeping track of the time that is available for the player to complete the task of collecting all the fruit, but we're also going to be adding a count of the lives that the player has left.

In order to present this information to the player, we need to display it on the screen, but we're not only going to implement text messages for our players to read — we're also going to introduce a graphical method of displaying some of the information.

We'll also be monitoring how many lives the player has remaining, and because we'll be creating additional levels for the game in Chapter 7, Polishing the Game, we must also keep track of the current level.

The last piece of information that we will need to work with is how many pieces of fruit have been collected; we need to know when players of our game have successfully completed a level!

In order to realize these goals, in this chapter, we'll be doing the following:

  • Displaying a countdown timer on the screen
  • Configuring fonts
  • Creating a game attribute to count lives
  • Using graphics to display information
  • Counting collected actors
  • Keeping track of the levels

Prior to continuing with the development of our game, let's take a little time out to review what we have achieved so far, and also to consider some of the features that our game will need before it can be published.

A review of our progress

The gameplay mechanics are now complete; we have a controllable character in the form of a monkey, and we have some platforms for the monkey to jump on and traverse the scene.

We have also introduced some enemy actors, the croc and the snake, and we have Aztec statues falling from the sky to create obstacles for the monkey. Finally, we have the fruit, all of which must be collected by the monkey in order to successfully complete the level.

With regards to the scoring elements of the game, we're currently keeping track of a countdown timer (displayed in the debug console), which causes the scene to completely restart when the monkey runs out of time. When the monkey collides with an enemy actor, the scene is not reloaded, but the monkey is sent back to its starting point in the scene, and the timer continues to countdown.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.139.81.210