O'Reilly logo

Learning ShiVa3D Game Development by Wade Tracy

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Game overlays

Okay, the truth is that overlays are not any different from menus except for the fact that they tend to give feedback to the player rather than provide the player with a means to choose between a set of options. Overlays are also built from components and use actions to interact with the game. Our overlays will simply be a health bar and a button for launching the in-game menu. Let's start with the button since it is the easiest and most familiar.

Create a custom event handler named LaunchMenu in MainAI. The code will be as follows:

this.MenuState ( )

We've seen this format before—we are just using a button to trigger a transition between game states. In this case, we are loading MenuState. What should happen when we load MenuState ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required