Game Development Reference
In-Depth Information
First we took a look at the JavaFX AudioClip class. We learned why it is perfectly
suited for use in our game development for audio, including short musical loops (using
the INDEFINITE constant setting) or rapid sound effects.
Next, we learned how to optimize digital audio assets using Audacity 2.0.6 . We
learned the work process for optimizing digital audio so that it takes only a dozen or so
kilobytes of system memory, and how to optimize audio so well that we do not even
have to apply compression, especially since audio compression codecs supported by
Java 8 are “lossy” codecs and can degrade the quality of the audio data once they are
decompressed into system memory.
Finally, we implemented AudioClip objects in our InvinciBagel.java class using a
.loadAudioAssets() method, and then created six .playiSound() methods to allow ex-
ternal classes to access and play these digital audio assets. We also added a .playAudi-
oClip() method in our Bagel.java class that triggered the audio samples based on which
keys were being pressed. In the next chapter, we are going take a look at how to add
collision detection to our game code.
Search WWH ::




Custom Search