18.2 Sound

The next class is soundManager. This one is pretty simple and you surely can write it yourself. There are no create methods required, only methods which play a particular sound. You will write these methods:

  1. startMusic: Start the soundtrack in a loop.
  2. blip: play the ‘blip’ sound.
  3. score: play the ‘rowdone’ sound.
  4. win: play the ’won’ sound.
  5. list: play the ‘lost’ sound.
  6. rotate: play the ’rotate’ sound.
  7. moveDown: playing the ‘down’ sound.

This class also needs only one instance, so you should create the a SoundManager below the class definition. Once done, you can create a little test in which you press keys to play a certain sound. Ensure that all sounds equally loud. If necessary, you can adjust the volume of certain sounds.