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 – turning input into movement


We'll now use the input library you imported to capture data from the controller and translate it into movement that will be applied to our marble by performing the following steps:

  1. Create a Scripts folder in your Assets directory to store all of your script files, if you haven't already done so, then right-click on it and create a new C# script.

  2. Name the file MarbleInputManager and open it in your preferred code editor.

    Recall the Start and Update functions from Chapter 3, Diving into Development, which will already be present in the code file; we'll be using Update for most of this chapter.

  3. To link the code file with your marble, left-click and drag it onto the prefab you created or add it as a new script component using the Add Component button in the Inspector menu.

    You can also drag it onto the actual marble on the screen, but this will only apply the script to that instance of the prefab; adding the script to the prefab itself will cause all...