Game Development Reference
In-Depth Information
int r = Math.random() * 255;
int g = Math.random() * 255;
int b = Math.random() * 255;
Paint p = new Paint();
p.setARGB(255, r, g, b);
return p;
}
Figure 3-6. The star field with game sprites
Playing Audio Clips
A good sound implementation is critical for any successful game. Android gives you two choices when
dealing with game sound:
Implement the sound logic in Java using Android's MediaPlayer API.
Implement the sound natively (in C or C++). This could be an option if you have
native code and wish to reuse it. This can be though as, by the time of this writing,
Google provides no support for native development.
Search WWH ::




Custom Search