28.04.2019 Views

[JAVA][Beginning Java 8 Games Development]

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 15 ■ Implementing Game Audio Assets: Using the <strong>Java</strong>FX AudioClip Class Audio Sequencing Engine<br />

The edit process is relatively easy: select the set part of setiSound and type “play” over the set; select the inside<br />

of the parameter area (AudioClip iSound#), and hit the delete or backspace key to remove that; and finally, select<br />

the “ = isound” part of the <strong>Java</strong> statement, inside of the method between this.iSound and the ; semicolon and type in<br />

.play() instead. The completed <strong>Java</strong> method bodies are shown in Figure 15-18 and should look like the following:<br />

public void playiSound0() {<br />

this.iSound0.play();<br />

}<br />

public void playiSound1() {<br />

this.iSound1.play();<br />

}<br />

public void playiSound2() {<br />

this.iSound2.play();<br />

}<br />

public void playiSound3() {<br />

this.iSound3.play();<br />

}<br />

public void playiSound4() {<br />

this.iSound4.play();<br />

}<br />

public void playiSound5() {<br />

this.iSound5.play();<br />

}<br />

Figure 15-18. Turn .setiSound() methods into .playiSound() methods by adding calls to the AudioClip .play() method<br />

www.it-ebooks.info<br />

339

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!