Book Image

Learning Java by Building Android Games

By : John Horton
Book Image

Learning Java by Building Android Games

By: John Horton

Overview of this book

Table of Contents (17 chapters)
Learning Java by Building Android Games
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Chapter 5. Gaming and Java Essentials

In this chapter, we will cover a diverse and interesting range of topics. We will learn about Java arrays, which allow us to manipulate a potentially huge amount of data in an organized and efficient manner.

Then, we will look at the role threads can play in games, in order to do more than one thing apparently simultaneously.

If you thought that our math game was a bit on the quiet side, then we will look at adding sound effects to our games as well as introducing a cool open source app to generate authentic sound effects.

The last new thing we will learn will be persistence. This is what happens when the player quits our game or even turns off their Android device. What happens to the score then? How will we load the right level the next time they play?

Once we have done all this, we will use all the new techniques and knowledge along with what we already know to create a neat memory game.

In this chapter, we will cover the following topics:

  • Java arrays—an...