November 2017
Beginner to intermediate
360 pages
6h 40m
English
Another type of input that mobile has, that PC doesn't, is the accelerometer. This allows you to move as the phone is tilted. The most popular example of this is likely the movement of the player in games such as Lima Sky's Doodle Jump. To do something similar, we can retrieve the acceleration of our device using the Input.acceleration property:
public enum MobileHorizMovement{ Accelerometer, ScreenTouch} public MobileHorizMovement horizMovement = MobileHorizMovement.Accelerometer; ...