Time for action — showing our player their health and score
We are now going to make two textboxes: one is to tell the player the score, and the other is to tell the player how many lives the character they are controlling has left. We'll also learn how to keep these textboxes on the screen with the player.
1. First, we will need to add a new layer to the layout. To do this, open the Layers tab on the right-hand menu, and click on the upward pointing paper button to make a new top layer.
2. Layers can be modified similar to objects. Open the left menu and rename the text layer to
HUD
(Heads Up Display), and the other layer toGame
.3. In the layer properties for HUD, change the
Scroll X Rate
andScroll Y Rate
percentages to0
. This keeps all objects on the HUD layer in the same position on the screen while the game is running.4. Now, make sure the HUD layer is highlighted, as shown in step 2. This means each object we make is created on that layer. Insert two new
Text
objects to the layout...