Book Image

Ouya Unity Game Development

By : Gary Riches
Book Image

Ouya Unity Game Development

By: Gary Riches

Overview of this book

Ouya is a microconsole running its own version of the Android operating system. The console features an exclusive Ouya store for applications and games designed specifically for the Ouya platform. It runs a modified version of Android 4.1 Jellybean, and is open to rooting without voiding the warranty. All systems can be used as development kits which allow any Ouya owner to be a developer without any licensing fee. Ouya Unity Game Development offers detailed, easy-to-follow, step-by-step instructions which will help you learn the ins and outs of Ouya development in Unity.From connecting your device with Android Debug Bridge to publishing it on the Ouya Developer Portal, this book will explain the processes involved in creating a game from scratch. As you progress through the book, you will learn about scenes, prefabs, sounds, models, and animations. By the end of the seventh chapter, you will have a 3D game with multiple levels, the possibility of in-app purchases, and controller support that runs on both the Ouya and an Android phone. Starting with an introduction to Ouya, you will learn how to set up an environment and render game levels on Ouya. You will learn how to change levels and how to save the current level. You will then dive into Ouya controller integration and character animation. This book will also teach you the workings of audio source components, and will show you how to add textures to prefabs. Finally, you will learn how you can monetize the game. By the end of this book, you will have the game running on Ouya and geared up to create games on your own.
Table of Contents (15 chapters)
Ouya Unity Game Development
Credits
About the Author
Acknowledgment
About the Reviewers
www.PacktPub.com
Preface
Index

Adding extra levels


Now that the game is looking better, we can add some more content in to it. Luckily the jagged array we created earlier easily supports adding more levels. Levels can be any size, even with variable column heights per row. Double-click on the Sokoban script in the Project panel and switch over to MonoDevelop. Find levels array and modify it to be as follows:

  // Create the top array, this will store the level arrays
  int[][][] levels = 
  {
    // Create the level array, this will store the row array
    new int [][] {
    // Create all row array, these will store column data
    new int[] {1,1,1,1,1,1,1,1},
    new int[] {1,0,0,1,0,0,0,1},
    new int[] {1,0,3,3,0,3,0,1},
    new int[] {1,0,0,1,0,1,0,1},
    new int[] {1,0,0,1,3,1,0,1},
    new int[] {1,0,0,2,2,2,2,1},
    new int[] {1,0,0,1,0,4,1,1},
    new int[] {1,1,1,1,1,1,1,1}
  },
  // Create a new level
  new int [][] {
    new int[] {1,1,1,1,0,0,0,0},
    new int[] {1,0,0,1,1,1,1,1},
    new int[] {1,0,2,0...