Game Development Reference
In-Depth Information
Figure 3-6 shows how the game should look on the emulator. To play, tap the screen and use the
arrows to move the ship around. Press the space bar to fire the gun.
Figure 3-8. The Run Configurations dialog for SpaceBlaster
What's Next?
In this chapter, you have taken the first steps in writing a simple Java game and looked at the different
issues that affect Java game development for Android, such as the significant differences between the
Android API and the Java ME standard and how that influences code reuse and multiplatform support.
You also learned gaming tricks, including creating an XML user-defined linear layout, using a timer task
to simulate a game loop, invalidating a view layout within a user-defined (non-UI) thread, loading
sprites and sounds, and dealing with the idiosyncrasies of the media player. You also saw some drawing
techniques for creating sprite animations and simple objects and setting text styles and colors using the
Paint object. Finally, I showed you how to deal with key and touch events.
In the next chapter, we take things further to create an arcade classic—Asteroids, a game that
presents a new set of challenges when dealing with drawing techniques.
Search WWH ::




Custom Search