Game Development Reference
In-Depth Information
mAudioMgr.startMusic(DoomClient.this, name, loop);
}
/**
* Stop bg music
*/
public void OnStopMusic(String name) {
if ( mSound && mAudioMgr != null)
mAudioMgr.stopMusic( name);
}
public void OnSetMusicVolume(int volume) {
if ( mSound && mAudioMgr != null)
mAudioMgr.setMusicVolume(volume);
}
Note Even though cascading audio in this way will make the game slower, it will provide high-quality sound to
the game. I believe it is a mistake by Google not to support open audio standards, such as the Advanced Linux
Sound Architecture (ALSA). After all, Android itself is built on open source foundations. This will hamper porting
efforts of thousands of native games out there.
Navigation Controls
Android devices feature a trackball, which is cumbersome for mobile games. In fact, most gaming
devices, such as PlayStation Portable (PSP) and Game Boy, feature multiple keypad arrows, which are
great for navigation. On the plus side, the QWERTY keyboard is helpful for PC games. But the latest
Android devices have neither a keyboard nor a trackball. Here is where the navigation controls can help.
Figure 7-3 shows the navigation controls in action during a game.
Figure 7-3. Navigation controls for Doom
Search WWH ::




Custom Search