Skip to content

Cs106a Breakout Assignment

posted 3 years ago

Hi,

I wrote the below program to set up and play the game breakout as an assignment for Stanford's CS106 programming class. I wrote it on my old mac running OSX 10.6.8, with the version of Eclipse JDK that works on that machine. When I tested it back on the mac, the program worked normally. But now I am using a Windows 8.1 computer with the corresponding version of eclipse, and when I test the program again, the sound effect I coded does not play. I get the following error message in console when the ball hits the paddle or brick, which previously caused the sound clip to play.

Exception in thread "Thread-4" java.lang.IllegalArgumentException: Requested value -120.0 smaller than allowable minimum value -80.0.
at javax.sound.sampled.FloatControl.setValue(Unknown Source)
at com.sun.media.sound.DirectAudioDevice$DirectDL$Gain.setValue(Unknown Source)
at acm.util.SoundPlayer.setLineVolume(SoundClip.java:909)
at acm.util.SoundPlayer.run(SoundClip.java:860)
at java.lang.Thread.run(Unknown Source)

I have no idea what the values it refers to could mean, or why my code would request a value below the min. I am using the mediatools class that is part of the ACM libraries we are required to use for the class to play the sound in question, found here: http://cs.stanford.edu/people/eroberts/jtf/rationale/UtilPackage.html#MediaTools.

I went ahead and tested all parts of the program and the missing sound effect is the only problem. Here is my complete code:

  • -

  • -

  • -

  • -

  • -

  • Wednesday 2:30:00 PM - 3:20:00 PM @ Green Earth Sciences134

  • Wednesday 3:30:00 PM - 4:20:00 PM @ Thornt208

  • Wednesday 3:30:00 PM - 4:20:00 PM @ Thornt207

  • Wednesday 4:30:00 PM - 5:20:00 PM @ Thornt210

  • Wednesday 5:30:00 PM - 6:20:00 PM @ Thornt208

  • Wednesday 5:30:00 PM - 6:20:00 PM @ Thornt209

  • Wednesday 5:30:00 PM - 6:20:00 PM @ 240-101

  • Wednesday 7:30:00 PM - 8:20:00 PM @ Thornt210

  • Wednesday 7:30:00 PM - 8:20:00 PM @ Thornt208

  • Thursday 10:30:00 AM - 1:20:00 PM @ 120-314

  • Thursday 10:30:00 AM - 11:20:00 AM @ 240-201

  • Thursday 10:30:00 AM - 11:20:00 AM @ 60-107

  • Thursday 10:30:00 AM - 11:20:00 AM @ 60-108

  • Thursday 10:30:00 AM - 11:20:00 AM

  • Thursday 11:30:00 AM - 1:20:00 PM

  • Thursday 11:30:00 AM - 12:50:00 PM @ Econ 139

  • Thursday 11:30:00 AM - 12:50:00 PM @ Thornt208

  • Thursday 1:30:00 PM - 2:20:00 PM @ 160-322

  • Thursday 1:30:00 PM - 2:20:00 PM @ Thornt209

  • Thursday 1:30:00 PM - 4:20:00 PM @ School of Education 230

  • Thursday 2:30:00 PM - 3:20:00 PM @ Thornt209

  • Thursday 2:30:00 PM - 3:20:00 PM @ 200-217

  • Thursday 2:30:00 PM - 3:20:00 PM @ 20-22K

  • Thursday 3:30:00 PM - 4:20:00 PM

  • Thursday 3:30:00 PM - 4:20:00 PM @ Thornt209

  • Thursday 3:30:00 PM - 4:20:00 PM @ Thornt211

  • Thursday 3:30:00 PM - 4:20:00 PM @ 20-22K

  • Thursday 3:30:00 PM - 4:20:00 PM @ 260-003

  • Thursday 4:30:00 PM - 5:20:00 PM @ Thornt210

  • Thursday 4:30:00 PM - 5:20:00 PM @ Thornt208

  • Thursday 4:30:00 PM - 5:20:00 PM

  • Thursday 4:30:00 PM - 5:20:00 PM @ Thornt209

  • Thursday 4:30:00 PM - 5:20:00 PM @ 300-303

  • Thursday 4:30:00 PM - 5:20:00 PM @ 260-012

  • Thursday 5:30:00 PM - 6:20:00 PM @ Thornt210

  • Thursday 5:30:00 PM - 6:20:00 PM @ 300-303

  • Thursday 5:30:00 PM - 6:20:00 PM @ 260-012

  • Thursday 7:30:00 PM - 8:20:00 PM @ Thornt207

  • Thursday 7:30:00 PM - 8:20:00 PM @ Thornt208

  • Thursday 8:30:00 AM - 9:20:00 AM @ Thornt208

  • Thursday 8:30:00 AM - 9:20:00 AM @ 200-124

  • Thursday 9:30:00 AM - 10:20:00 AM @ Gilbert Biological Science 117

  • Friday 10:30:00 AM - 11:20:00 AM @ Thornt210

  • Friday 10:30:00 AM - 11:20:00 AM @ School of Education 130

  • Friday 10:30:00 AM - 11:20:00 AM @ 380-381T

  • Friday 11:30:00 AM - 12:20:00 PM @ 50-52E

  • Friday 11:30:00 AM - 12:20:00 PM @ School of Education 130

  • Friday 11:30:00 AM - 12:20:00 PM @ 380-381T

  • Friday 2:30:00 PM - 3:20:00 PM @ Thornt209

  • Friday 2:30:00 PM - 3:20:00 PM @ Thornt208

  • Friday 2:30:00 PM - 3:20:00 PM @ 260-001

  • Friday 2:30:00 PM - 3:20:00 PM @ Thornt207

  • Friday 3:30:00 PM - 4:20:00 PM @ 460-334

  • Friday 3:30:00 PM - 4:20:00 PM @ 260-001

  • Friday 3:30:00 PM - 4:20:00 PM @ Thornt208

  • Friday 3:30:00 PM - 4:20:00 PM @ 380-381T

  • Friday 4:30:00 PM - 5:20:00 PM @ 260-001

  • Friday 4:30:00 PM - 5:20:00 PM @ 200-219

  • Friday 4:30:00 PM - 5:20:00 PM @ Thornt208

  • Friday 8:30:00 AM - 9:20:00 AM @ 20-22K

  • Friday 9:30:00 AM - 10:20:00 AM @ Gilbert Biological Science 117

  • Friday 9:30:00 AM - 10:20:00 AM @ 460-334