Book Image

Android Game Programming by Example

By : John Horton
Book Image

Android Game Programming by Example

By: John Horton

Overview of this book

Table of Contents (18 chapters)
Android Game Programming by Example
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
7
Platformer – Guns, Life, Money, and the Enemy
Index

Finishing touches


We can continue to improve our game. For example, it wouldn't be too hard to spawn two or three smaller asteroids when the current asteroid is destroyed. We just need an array to hold the smaller asteroids. When we deactivate the regular asteroid, the array activates some previously instantiated smaller ones at the same location as the regular one. We can then make some minor modifications to the way we count asteroids, and we will have a neat new feature.

The arcade classic, Asteroids, had a mean UFO that would turn up occasionally. It would be simple to design a UFO shape from lines, and have it randomly proceed from left to right, or right to left, moving up and down a bit as well.

Finally, we can add a hyperspace button. This is a kind of last resort for the player when they are sure that death is imminent. Tap the hyperspace button and the ship will respawn in a random location. We will just need to add a button to the array in the InputController class and a call to...