5.2.3 FX

Short sounds can also be played with the method SoundPlay(). This will play the sound directly, without requiring you to create an object of the class Sound. Because there is no object you won’t have any control over the sound after you started it. Therefore this technique will mostly be used for very short effects, such as footsteps.

Exercise
In the template project you will find a few sounds in the folder ‘sound’. Create an application that plays back a ‘blip’ every time you push the arrow-down key. Use the ‘rotate’ sound for arrow-left and arrow-right. And last, play back the ‘down’ sample when you press the space bar.

Extra: Add the soundtrack again, but this time control the volume of the track with the mouse wheel.