HTML and CSS Reference
In-Depth Information
Touch
Most mobile devices support touch events that act much like their mouse counterparts but with the addition
of touch tracking and multitouch, meaning you can track more than one touch at a time, which is important
for action games where you need to have onscreen controls.
Orientation
and Accel-
eration
Supports detecting changes to orientation and acceleration events when a user physically moves their
phone around.
Application
Cache
Allows you to cache the assets needed for your game offline, meaning you can configure your game to
launch without any Internet access.
Offline St-
orage
Provides ability to store the game state locally. It means you don't need to save everything constantly to the
server and can let your players pick up right where they left off, without needing access to a server.
Geolocation Has the ability to detect the physical location of a player in the real world.
What's Coming: WebAPI
Although the APIs available provide access to a number of the features on mobile devices, some significant
gaps still exist as of this writing. The Mozilla WebAPI project aims to fill those gaps with access to hardware
and operating system resources that would normally be available for only native apps. Cool stuff like access
to the camera, file system, and vibrator motor could make for interesting features to build a game around. The
progress of WebAPI is documented on the Mozilla wiki at https://wiki.mozilla.org/WebAPI .
Surveying the Mobile Browser Landscape
Before the advent of the iPhone and Mobile Safari in 2007, web browsing on your phone was in a sad state of
affairs, with only Opera offering a mobile browsing experience that didn't view mobile browsing as a limited,
menu-driven experience. In the years since, mobile browsers have become more capable, and the JavaScript
engines on those browsers have become better by leaps and bounds.
What was unimaginable five years ago, that you could play the same web games on your phone as on your
desktop browser, is slowly approaching reality with every new HTML5 game that pops on to the scene. Al-
though the hardware is important, much like the situation on the desktop, the browser that runs on your target
device is the most important arbiter of the features available.
WebKit: The Market Dominator
The good news is that unlike the desktop, the two dominant smartphone platforms—iOS and Android—have
excellent mobile browsers. Even better, they both share the WebKit engine, which means that you can expect
a comparable set of features and rendering engine between the two. WebKit isn't the only mobile HTML5
browser in town, but WebKit browsers do make up more than 80% of mobile U.S. traffic as of December 2011,
according to www. statcounter.com .
WebKit began its life as the KHTML rendering engine and KDE JavaScript engine (KJS) inside the open-
source Konquerer web browser. Apple adopted (and forked) KHTML and KJS and rebranded them as WebCore
and JavaScriptCore under the umbrella of WebKit.
Search WWH ::




Custom Search