Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying OUYA Game Development by Example
  • Table Of Contents Toc
  • Feedback & Rating feedback
OUYA Game Development by Example

OUYA Game Development by Example

By : John Donovan
4 (3)
close
close
OUYA Game Development by Example

OUYA Game Development by Example

4 (3)
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)
close
close
OUYA Game Development by Example Beginner's Guide
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
2
Index

Time for action – adding keyboard interaction to scripts


Perform the following steps to add keyboard interaction to your scripts:

  1. Add the following if statement to your Update function that checks if the Return key is pressed:

    // Update is called once per frame
    void Update()
    {
      if(Input.GetKeyDown(KeyCode.Return))
      {
    
      }
    }

    Everything contained within the if statement will run every time the Update function detects that the Return key has just been pressed down (there's a slightly different way to check if a key is being held down, but we'll cover that in the next chapter).

    We could add code directly inside the if statement to change the color of the text, but it's better to write a function for an action like that in case you want to replicate the same functionality outside of that if statement without writing redundant code, so we'll create a dedicated ChangeColor function.

  2. Declare the ChangeColor function below the Update function in your ColorChanger script, as shown in the following code...

Visually different images
CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
OUYA Game Development by Example
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon