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—putting the HTML5 games into a Mac app


Follow the steps in Mac Xcode. We need a Mac and the Apple Xcode to create a Mac OS X app. Download Xcode from the Mac App Store if you haven't got it.

Note

Even if you don't have a Mac, you can still have a look at how we wrap the Web View with an application. The concept is more important than the steps in this section.

  1. Launch Xcode and create a new project. Select Cocoa Application under OS X:

  2. In the Options View, give the name of the game as Product Name. Organization Name can be your name or a company's name. Use a reversed domain as Organization Identifier. Choose Objective-C for this code example. We keep the default value for the other options.

  3. Open the Main.storyboard file from the left panel. In the bottom-right panel, choose the third tab (which is highlighted in blue in the following screenshot). Drag the Web View component into the Window View. The Web View should become full width and height when you drag and drop it into the...