Book Image

HTML5 Game Development by Example: Beginner's Guide

By : Seng Hin Mak
Book Image

HTML5 Game Development by Example: Beginner's Guide

By: Seng Hin Mak

Overview of this book

Table of Contents (18 chapters)
HTML5 Game Development by Example Beginner's Guide Second Edition
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
9
Building a Physics Car Game with Box2D and Canvas
Index

Time for action – adding a meta tag for a mobile web app


We will take an audio game as an example to begin with. Let's perform the following steps:

  1. Open the index.html file in the code editor.

  2. Add the following code within the head section.

    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon" href="game-icon.png">
    <link rel="apple-touch-startup-image" href="launch-screen.png">
  3. Test the game on an iOS device or a simulator. To do this, try tapping on the Share button and then select Add to Home Screen. You should see the icon and the name of the game. Continue to add the game to the home screen.

  4. Then, open the game from the home screen. It will open in fullscreen mode.

  5. Double-click on the home button to enable the app-switching screen. You will be able to see that the app has its own place, similar to a natively installed application.

    Note

    If you are developing on Mac, you...