October 2014
Intermediate to advanced
516 pages
11h 53m
English
We will get started with the Libgdx sound system by playing short sound effects, also known as SFX. Often, effects go unnoticed, and this is really unfair towards them! As an exercise, try turning the effects' volume down in an action shooter and see how much you enjoy it. It is not the same experience at all, is it?
The sample shown in this recipe will illustrate how to play, pause, resume, and stop sounds. We will map the number keys from 1 to 7 to different sounds. The P key will pause the sounds, R will resume playback, and S will stop playback.
Make sure the sample projects are in your Eclipse workspace to follow this recipe.
The code for this recipe will be found in the SoundEffectSample ...
Read now
Unlock full access