Making a game work on a mobile platform is not only about the screen resolution, but also about changing from a mouse cursor input to touches and a lot of performance tuning. In this task, we make the game work better on mobile phones by providing touch screen support.
When we publish the game on the Web, we can have several settings to enhance the experience when playing on a mobile touch device. We add the following launch screen and app icon to the images folder:
We need another library to help improve the clicking events on a DOM element in mobile devices. It eliminates a clicking delay that is added by the mobile platform. We will discuss the delay later. Download the fastclick.js
file from https://github.com/ftlabs/fastclick and add it to the vendors
folder. Make sure we import this file in the index.html
file.