Skip to Content
Mobile Game Development with Unity
book

Mobile Game Development with Unity

by Jonathon Manning, Paris Buttfield-Addison
August 2017
Beginner
464 pages
9h 18m
English
O'Reilly Media, Inc.
Content preview from Mobile Game Development with Unity

Chapter 5. Preparing for Gameplay

Now that the gnome and the rope have both been created, it’s time to set up the system that lets the user provide input to the game.

We’ll do this in two parts: first, we’ll add the script that makes the gnome swing from side to side when the phone is tilted. After that, we’ll add the buttons that lengthen and retract the rope.

Once that’s done, we’ll begin implementing the code that drives the game itself: first, we’ll do a bunch of setup work that the gnome will end up using, and then we’ll implement a manager object that keeps track of some important game states.

Input

Because we’re now at the point where we need to get input from the device, it’s time to make sure that the Unity Editor can receive input. Without this, the only way to test the game is to build the game and install it on a device, which can take a while. Unity’s all about being able to rapidly test your changes, and waiting for a build to finish will slow you down a lot.

Unity Remote

To allow quickly providing input to the Unity Editor, Unity has an app on the App Store called the Unity Remote. Unity Remote connects to the Unity Editor through your phone’s cable; when the game is playing in the Editor, the phone displays a copy of what’s being shown in the Game window, and sends back all touch and sensor information to your script. This allows you to test the game without having to do a build—all you need to do is launch the app on your phone, and play the game as if it were ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Holistic Mobile Game Development with Unity

Holistic Mobile Game Development with Unity

Penny de Byl

Publisher Resources

ISBN: 9781491944738Purchase bookErrata Page