HTML and CSS Reference
In-Depth Information
Figure 4-4: An SVG cannon game.
Considering HTML5 from a Mobile
Perspective
One of the phrases that you hear a lot these days is “mobile first.” This phrase means considering mobile devices
as your primary target and considering support for additional browsers later on. This might not seem obvious
with mobile browsers, as of 2012, barely in the double digits of overall usage, but it's more than just a numbers
game. Considering mobile devices first means you start with a number of significant constraints and work out
from there.
Mobile devices have small screens and screens of different sizes and aspect ratios. They have limited pro-
cessing power and bandwidth and often have limited storage. All these constraints force you, as a developer, to
optimize your web app—make it more adaptable; make it load faster and be more performant. Not surprisingly,
these are all things that can bring a better experience to users with desktop browsers as well. Web developers
have been a bit lazy, viewing their projects on 30-inch monitors connected to fat Internet pipes and running
on four-core multithreaded processors. Most likely a good portion of your target demographic for casual web
games doesn't share the same hardware specifications. Considering the mobile usage of your site as a primary
consideration can help you move away from that attitude.
Understanding the New APIs
The family of specifications tied together as “HTML5” is a large family, and some pieces you couldn't care
less about from a game perspective. Are advances in semantic, tags such as the <aside> , and support for mi-
crodata actually going to help you build a great game? Probably not. But there are a lot of exciting Application
Programming Interfaces (APIs) that you should care about, the most interesting of which from a game perspect-
ive are shown in Table 4-1 .
Table 4-1: New HTML5 APIs
API Name
Description
 
 
 
Search WWH ::




Custom Search