Game Development Reference
In-Depth Information
hold our AudioClip related code, in case we want to add more than six digital audio as-
sets into our game in the future.
It is important to note that due to the versatility of the AudioClip class as far as
pitch shifting and 2D spatial (left to right) audio movement is concerned, you should
not need as many audio assets as you might think, because you can turn even six well-
designed audio assets into literally hundreds of different sound effects for your game
play.
Adding Your Audio Asset Loading Method: .loadAu-
dioAssets()
Create a method call inside of your start() method, as seen in Figure 15-13 , called
loadAudioAssets() ; and place it in the logical method order right before the
loadImageAssets(); method invocation. To get rid of the wavy red error high-
lighting, add a private void loadAudioAssets(){} empty method after the
createSceneEventHandling() method. In this way, your digital audio assets will be ref-
erenced and loaded into memory right after your KeyEvent handling is set up, and right
before your digital image assets are referenced and loaded into memory.
 
 
Search WWH ::




Custom Search