Chapter     4

The Menu Screen

You might have already built a game, or are in the process of building one, but still need a proper menu screen from which to launch it. Fear not. If you are having problems creating a working menu screen for your game, this chapter should be able to help you out.

In this chapter, you will find solutions for creating a two-button menu screen, wiring the buttons on said menu screen to start and exit the game, and many more problems that could arise while you create a menu.

The first solution will give you a proper, two-button menu screen for your game.

4.1 Create a Two-Button Menu Screen

Problem

Your game needs a menu screen for presenting options to the player.

Solution

Create a menu using an Android layout ...

Get Android Game Recipes: A Problem-Solution Approach now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.