Creating the UI for our game

If you are not familiar with the term the UI, you must be wondering what the heck is it? UI is an abbreviation for User Interface. To put simply, a UI can consist of all the information you need to display on your game screen or your onscreen controls. Common elements of a UI include the following:

  • Text displayed on the screen
  • Buttons
  • Joystick pad
  • Tutorial instructions

In this part of our chapter, we will learn how to display text on the screen. We will also instruct the player how to play the game. We will display the following on our screen:

  • Distance ran
  • Best score
  • Instructions on how to play

So, here we have to display the best score. However, we haven't created our best score variable yet. For this part, ...

Get Learning Android Game Development now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.