Game Development Reference
In-Depth Information
as on paper everything else about Android is pretty awesome.
One of the best things about it is that starting with version 2.1
(and 2.2 more solidly), the Android OS allows for the use of Flash in
two flavors:
￿
Asaplug-intotheAndroidOSWebbrowser,soyoucanview
Web sites just as you would on a desktop
￿
In the form of AIR, Adobe
s integrated package for desktop
applications built using HTML and Flash
In this chapter, we
'
ll be looking at the second of these two
options, using AIR for Android to publish a game directly to the
device. To use this example, you
'
ll need an Android phone or
tablet supporting v2.2 of the OS, like many newer devices by HTC,
Motorola, Samsung, and Google. If you have such a device, you
'
ll
need to visit the Android marketplace and download Adobe AIR
for it. Also, while in the name of the chapter, I call it out as a tablet
game; Android tablets are, as of this writing, still very expensive.
I actually developed this example on a Google Nexus One, so it
is playable on a phone. I simply imagined that the experience
would be better on a much larger screen with more room to move
around.
'
A Trio of Topics
In each of the examples in this topic, I
ve tried to introduce new
aspects of game development along the way, even if they are only
indirectly related to the example. This chapter will cover three
topics I have mentioned only in passing up until now:
￿
'
Multitouch input (with an Android device, though the same API
works with iOS)
￿
A finite-state machine for controlling game flow and logic
(referenced in Chapter 1)
￿
A full rigid-body physics engine that is open-source, fast, and
used in many popular Flash games
This may seem like a lot, but don
m not diving terri-
bly deep into any of these topics, just what we need to get the job
done. By the time you finish with this chapter, you should feel
totally comfortable building games that use all three of the above
elements, as well as beginning to dig deeper into each of them.
We
'
tworry
I
'
'
ll pull all of these pieces together to create a simple, two-player
air hockey game like the one you may have played in an arcade or
even at someone
'
s house.
Multitouch Input for Devices
In Chapter 15, we explored using the accelerometer in a device to
control movement in a game. The other primary means of input
Search Nedrilad ::




Custom Search