Chapter 3

Going Mobile

In This Chapter

• Designing for mobile devices

• Supporting different screen resolutions

• Creating the main menu

• Making web applications for iOS

THIS CHAPTER COVERS some of the advantages and challenges you face when taking your web application to the mobile platform. It briefly discusses how user interaction on mobile devices differs from interaction on the desktop before explaining the concept of the viewport and how to make the game scale correctly on small screens.

The chapter then moves on to CSS media queries and shows how you can use them to create views of your game that adapt to and look good on both low- and high-resolution devices, regardless of their orientation.

In this chapter, you also find out how to make your applications and games feel like native applications by toggling the iOS web application mode and disabling some default browser behavior.

Finally, you discover a few tricks that can help you debug your iOS and Android web applications.

Developing Mobile Web Applications

Today hundreds of millions of devices, smartphones, and tablets run on software such as Apple's iOS and the Google-backed Android system. These devices can run most advanced applications and games built with HTML5.

Games have been particularly successful on platforms like iOS and Android. If you look through lists of the most downloaded iPhone and Android applications, you're bound to find several games, some at the top spots. Since the days of Snake on Nokia phones, ...

Get HTML5 Games: Creating Fun with HTML5, CSS3 and WebGL, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.