Implementing a level progression routine

Although the transitioning between levels currently does its job quite well (the next level is automatically displayed when all the fruit has been collected), there is definitely room for improvement. The main problem with the current configuration is that the transition to the next level happens without any warning, so it would be a good idea to allow the player to pause and take a breath before continuing with the game.

We're going to implement a system that displays a message for the player, and which offers the opportunity to either progress to the next level or return to the main menu scene by clicking on the appropriate buttons. We haven't created the main menu scene yet, we'll be doing that later in this chapter!

Although implementing the success message is not difficult, it requires quite a few steps, so we'll break the process down into the following two Time for action sessions:

  • Displaying the message and buttons
  • Responding to the player's selection

Displaying the message and buttons

Let's start with a framework for displaying the message and buttons.

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

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