Part 4 – User Interface
The final piece your game needs is a user interface (UI). This is an interface to display information that the player needs to see during gameplay. In games, this is also referred to as a Heads-Up Display (HUD), because the information appears as an overlay on top of the game view. You'll also use this scene to display a start button.
The HUD will display the following information:
- Score
- Time remaining
- A message, such as Game Over
- A start button
Node setup
Create a new scene and add a CanvasLayer
node named HUD
. A CanvasLayer
node allows you to draw your UI elements on a layer above the rest of the game, so that the information it displays doesn't get covered up by any game elements like the player or the coins.
Godot provides a wide variety of UI elements that may be used to create anything from indicators such as health bars to complex interfaces such as inventories. In fact, the Godot editor that you are using to make this game is built in Godot using these elements. The...