Touch control
Until now we've only talked about the problematic parts of mobile devices, but there are also advantages that come with these devices. Touch screens allow for a very interesting game mechanism (and multi-touch screens even more so).
In this section, we will implement two different ways of controlling our game with touches, but it's really a field where you can be creative and find novel and engaging ways for the player to interact with your game. What is important to know is that the API for touch control is not standard, and mobile devices may implement it with some differences. Nevertheless, the code shown in the following section should work on iOS and on recent versions of Android.
Both interfaces we will implement are based on the same basic idea: the whole screen is a joypad, and no visible UI elements are used. The advantage of this is that the bigger the surface used for control, the more precise the control. The disadvantage is that you need to explain to the user how...