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 target for the cannon


To complete our prototype, we'll add a target for the player to attempt to hit with a cannonball and make it change color when they've successfully hit it. Perform the following steps to do so:

  1. Create a new Cube from the Hierarchy window's Create menu.

  2. Position the cube at 20, 5, 0 so that it's on the opposite end of the plane from the cannon and slightly higher than it.

    Your cube should look as shown in the following screenshot:

    We want our target cube to be a bit larger and easier to see, so we'll make a few more changes to it.

  3. Increase the scale of the cube to 3, 3, 3.

  4. Create a new Material, assign it a unique color, and apply it to your target by clicking-and-dragging it from the Project window to the cube in the Hierarchy window.

    After making the previous changes, your target cube should look as shown in the following screenshot:

    Now that our cube is a clear target, we can script it to react when a cannonball hits it. In full games, hitting...