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
About the Author
About the Reviewers

Adding additional functionality to our marble

Let's give the marble a jumping ability so that the player can leap over obstacles. This will be pretty simple, but button input works a little differently than axis input, as you'll see in this section.

Movement code works well in the Update function, because it updates very slightly for every frame based on the position of the arrow keys or joysticks. However, jumping isn't a gradual movement; it's an immediate command. So, if we were to send a jump command while a button was pressed down, several frames would pass in the time that it took us to press the button and release it, resulting in several jumps sent in quick succession. To remedy this, we'll tell Unity to only send the jump command if the jump button is pressed down and was not pressed down in the last frame. This is done with an input function called GetKeyDown/GetButtonDown. In the future, if you ever want to capture button status for every frame regardless of its earlier status...