Game Development Reference
In-Depth Information
Figure 5-1. Doom for Android architecture
This process continues in an endless loop where key and touch events are dispatched back
to the DSO, which updates the game accordingly.
The game is composed of the following Java packages:
org.doom : This is the main game package and it contains the main
activity DoomClient.java . This class controls the application life cycle
and the key and touch events, dispatches sound and music requests to
the audio classes, and dispatches user events to the DSO through the
native interface class.
doom.audio : This package contains the audio classes AudioManager and
AudioClip .
AudioManager : This class is in charge of playing sounds and
background music using AudioClip . It also caches sounds for
better performance.
AudioClip.java : This class is capable of playing, stopping, and
looping a sound using the Android MediaPlayer . Sound files use
the WAVE format.
doom.jni : This JNI package contains the native interface class
Natives.java . This class is a two-way pipe for all access with the DSO.
This includes native Java methods and C to Java callbacks.
doom.util : This package contains the following utility classes:
DialogTool.java : This class contains miscellaneous dialogs to
start the game and install shareware game files, message boxes,
and other items.
DoomTools.java : This class contains basic game constants and
commonly used subroutines.
Search WWH ::




Custom Search