O'Reilly logo

Learn Unity 4 for iOS Game Development by Philip Chu

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter     13

Handling Device Input

Although our bowling game is up and running on iOS, it’s not quite in a playable state, because we don’t have any working player controls. Which brings us to the issue of input handling, perhaps the most obvious difference between desktop and mobile games.

Instead of reading the mouse or keyboard, an iOS game has to use one of its device sensors, typically the touchscreen (tapping and swiping) or accelerometer (shaking and tilting). We’ll opt for touchscreen input to control the bowling ball, but we’ll do some shake detection with the accelerometer and play with the device camera a little bit, too.

The project for this chapter on http://learnunity4.com/ has the script changes introduced in this chapter, and ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required