Game Development Reference
In-Depth Information
Chapter 7. HTML5
and
Mobile
Game
Development
In this last chapter we will take a look at the ever so important concept of not only
developing for multiple browsers and platforms, but also of developing an applica-
tion with multiple devices in mind. It used to be that web development was all about
supporting multiple browsers. Then it became all about taking advantage of the latest
technologies available and creating applications that resembled a native desktop ap-
plication. Today, we must not only remember those same concepts that allow us to
make our applications available to as many people as possible, but we must also re-
member that the standard desktop computer is not the only machine accessing our
web applications.
While creating an HTML5-based game or application, we must be able to envision
our users connecting through the desktop computer, net-books, HTML5-ready video
game systems, smart phones, tables, television sets, and soon their smart watches,
smart glasses, and possibly their smart toasters, fish tanks, and so on. Needless to
say, there are quite a few differences between these devices, other than their size,
shape, and suggested retail price.
As we develop the last game in this topic, lets take a look at some of the most import-
ant concepts related to mobile game development with HTML5. We'll first look at fun-
damental differences between a desktop machine and a mobile device (specifically, a
smart phone and a tablet). The two HTML5-related APIs discussed in the chapter are
media queries (which allows us to adjust CSS properties based on the current state
of the device viewing the application) and JavaScript touch events, with their corres-
ponding event handlers. Finally, we'll conclude the chapter with a discussion on how
to go about developing and optimizing a game for a desktop browser as well as a mo-
bile device, with a single code base.
Desktop versus mobile
At first sight, the careless web developer might be led to believe that, because many
of today's smart phones are in fact quite a lot smarter than most fifth graders, that
their fancy web applications and games will run just fine on a mobile device. Do not
be deceived! Although it is true that your smart phone is indeed smarter than you
Search WWH ::




Custom Search