@@ -0,0 +1,1380 @@
+/**%0A * %0A */%0Apackage snake;%0A%0Aimport java.io.IOException;%0A%0Aimport javax.sound.sampled.AudioInputStream;%0Aimport javax.sound.sampled.AudioSystem;%0Aimport javax.sound.sampled.Clip;%0Aimport javax.sound.sampled.LineUnavailableException;%0Aimport javax.sound.sampled.UnsupportedAudioFileException;%0A%0A/**%0A * @author Aaron%0A *%0A */%0Apublic class Sound %7B%0A%09private Clip clip;%0A%09private String fileName;%0A%0A%09/**%0A%09 * %0A%09 */%0A%09public Sound(String fileName) %7B%0A%09%09this.fileName = fileName;%0A%09%7D%0A%09%0A%09/**%0A%09 * This method plays the sound%0A%09 */%0A%09public void play()%7B%0A%09%09loadSound();%0A%09%09clip.setFramePosition(0);%0A%09%09clip.start();%0A%09%7D%0A%09%0A%09/**%0A%09 * This method loops the sound%0A%09 */%0A%09public void loop()%7B%0A%09%09loadSound();%0A%09%09clip.setFramePosition(0);%0A%09%09clip.loop(Clip.LOOP_CONTINUOUSLY);%0A%09%7D%0A%09%0A%09/**%0A%09 * This method stops the sound%0A%09 */%0A%09public void stop()%7B%0A%09%09clip.stop();%0A%09%7D%0A%09%0A%09/**%0A%09 * This method closes the sound and releases the resource from memory%0A%09 */%0A%09public void close()%7B%0A%09%09clip.close();%0A%09%7D%0A%09%0A%09/**%0A%09 * This method loads the sound into memory%0A%09 */%0A%09private void loadSound()%7B%0A%09%09try %7B%0A%09%09%09AudioInputStream audio = AudioSystem.getAudioInputStream(this.getClass().getResource(fileName));%0A%09%09%09clip = AudioSystem.getClip();%0A%09%09%09clip.open(audio);%0A%09%09%7D catch(UnsupportedAudioFileException e)%7B%0A%09%09%09e.printStackTrace();%0A%09%09%7D catch(LineUnavailableException e)%7B%0A%09%09%09e.printStackTrace();%0A%09%09%7D catch(IOException e)%7B%0A%09%09%09e.printStackTrace();%0A%09%09%7D%0A%09%7D%0A%0A%7D%0A

Add Sound.java