Book Image

OUYA Game Development by Example

By : John Donovan
Book Image

OUYA Game Development by Example

By: John Donovan

Overview of this book

The OUYA console and development kit gives you the power to publish video games for the players, creating a console marketplace of the gamers, for the gamers, and by the gamers. Using the OUYA developer kit and the Unity3D game engine, even beginners with a captivating game idea can bring it to life with a hint of imagination. OUYA Game Development by Example uses a series of feature-based, step-by-step tutorials that teach beginners how to integrate essential elements into a game engine and then combine them to form a polished gaming experience.
Table of Contents (18 chapters)
OUYA Game Development by Example Beginner's Guide
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Index

Time for action – creating a loss screen


You can already exit the game by winning because we coded a collision with the cube at the other end of the level to result in the win screen being displayed. However, if the player accidentally rolls off the level, there's no way for them to get back up and try again.

To fix this, we'll create a loss screen that lets the user replay the game. The process of building our loss screen will follow our process of building the title screen, but we'll also create a trigger so that the loss screen is displayed when the marble falls off the level. Perform the following steps to create a loss screen:

  1. Create a new scene called LossScreen in your RollingMarble project.

  2. Set your preferred background color in the Inspector window for the Main Camera object in the Hierarchy window.

  3. Create a new GUI Text object from the Create menu in the Hierarchy window.

  4. Set the Text property of the new GUI Text object to read You Lose.

  5. Set the font size of the GUI Text object to be...