Controlling with tilt
Modern mobile devices possess a broad variety of internal sensors for detecting and providing information about the surronding world. Though you may not have thought of them in such a way, you are certainly most familiar with the microphone and speaker that are required for making calls. There is a Wi-Fi receiver for connecting to the Internet and a camera for taking pictures. Your device almost certainly has a magnetometer to work with your GPS to provide directions.
The sensor we are interested in right now is the gyroscope. This sensor detects local rotation of the device. In general, it is used to determine the orientation of the device. We are going to use it to steer our ship. When the user tilts their device left and right, their space ship will turn to the side. When the device is tilted up and down, the ship will go up and down.