Another widely used feature in smartphones and tablets is the built-in gyroscope. This component allows basic motion controls that are read by their movement. The most common use of device tilt is to control the screen's visual orientation, but it can also be used for games. We're going to take a look at how to use tilt controls to move an object around.
Before we begin, you'll need to set up your room for a mobile device. As we'll test tilt functions that utilize an accelerometer, this recipe can only be tested on a mobile device, such as a smartphone or tablet. With the purchase of a GameMaker Professional license, you can test them on Android devices without purchasing the exporter. If you wish to test on iOS or Windows mobile devices, you'll need to purchase their respective export licenses. For this recipe, I used the Android target in portrait mode for testing purposes. I set the room to 768 px wide by 1280 px high and locked...