Using Threads and Tones

  • Carol Hamer


In this chapter, you’ll improve the Tumbleweed game from the previous chapter by adding some new threads. One of the new threads will make the algorithm that releases the tumbleweeds more efficient, and the other new thread will play background music. You won’t need to change some of the classes for this version, and therefore the code for certain classes won’t be repeated in this chapter. Please see Chapter 3 if you’d like to review the source code for GameThread. java, Cowboy. java, and Grass. java (which the current example also uses). The following listings include the code for the modified classes.


Audio File Target Device Main Thread Java Package Music File 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

Copyright information

© Carol Hamer 2004

Authors and Affiliations

  • Carol Hamer

There are no affiliations available

Personalised recommendations