diff --git a/build/built-jar.properties b/build/built-jar.properties index 1728f02..4bd3e32 100644 --- a/build/built-jar.properties +++ b/build/built-jar.properties @@ -1,4 +1,4 @@ -#Tue, 05 Feb 2019 17:53:07 -0600 +#Tue, 05 Feb 2019 18:09:27 -0600 C\:\\Users\\cd109\\Desktop\\CancerGrowth= diff --git a/build/classes/cancergrowth/CellPanel$1.class b/build/classes/cancergrowth/CellPanel$1.class index 45c253d..5579589 100644 Binary files a/build/classes/cancergrowth/CellPanel$1.class and b/build/classes/cancergrowth/CellPanel$1.class differ diff --git a/build/classes/cancergrowth/CellPanel$2.class b/build/classes/cancergrowth/CellPanel$2.class index a16230d..33503d6 100644 Binary files a/build/classes/cancergrowth/CellPanel$2.class and b/build/classes/cancergrowth/CellPanel$2.class differ diff --git a/build/classes/cancergrowth/CellPanel$3.class b/build/classes/cancergrowth/CellPanel$3.class index 70c144f..61d7c8d 100644 Binary files a/build/classes/cancergrowth/CellPanel$3.class and b/build/classes/cancergrowth/CellPanel$3.class differ diff --git a/build/classes/cancergrowth/CellPanel.class b/build/classes/cancergrowth/CellPanel.class index b437a0a..14b6a7b 100644 Binary files a/build/classes/cancergrowth/CellPanel.class and b/build/classes/cancergrowth/CellPanel.class differ diff --git a/dist/CancerGrowth.jar b/dist/CancerGrowth.jar index ad79579..1d78942 100644 Binary files a/dist/CancerGrowth.jar and b/dist/CancerGrowth.jar differ diff --git a/dist/lib/jl1.0.1.jar b/dist/lib/jl1.0.1.jar new file mode 100644 index 0000000..bd5fb8b Binary files /dev/null and b/dist/lib/jl1.0.1.jar differ diff --git a/build/classes/data/pacman.mp3 b/dist/lib/pacman.mp3 similarity index 100% rename from build/classes/data/pacman.mp3 rename to dist/lib/pacman.mp3 diff --git a/src/data/pacman.mp3 b/lib/pacman.mp3 similarity index 100% rename from src/data/pacman.mp3 rename to lib/pacman.mp3 diff --git a/nbproject/project.properties b/nbproject/project.properties index f3c531f..e09d35d 100644 --- a/nbproject/project.properties +++ b/nbproject/project.properties @@ -29,10 +29,12 @@ dist.jar=${dist.dir}/CancerGrowth.jar dist.javadoc.dir=${dist.dir}/javadoc endorsed.classpath= excludes= +file.reference.jl1.0.1.jar=C:\\Users\\cd109\\Desktop\\jl1.0.1.jar includes=** jar.compress=false javac.classpath=\ - ${libs.swing-layout.classpath} + ${libs.swing-layout.classpath}:\ + ${file.reference.jl1.0.1.jar} # Space-separated list of extra javac options javac.compilerargs= javac.deprecation=false diff --git a/src/cancergrowth/CellPanel.java b/src/cancergrowth/CellPanel.java index 83c5499..5f42a28 100644 --- a/src/cancergrowth/CellPanel.java +++ b/src/cancergrowth/CellPanel.java @@ -13,6 +13,11 @@ import java.awt.event.ActionListener; import javax.swing.Timer; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; +import java.io.FileInputStream; +import java.io.FileNotFoundException; + +import javazoom.jl.decoder.JavaLayerException; +import javazoom.jl.player.Player; public class CellPanel extends javax.swing.JPanel implements ActionListener, ChangeListener { @@ -24,7 +29,7 @@ public class CellPanel extends javax.swing.JPanel implements ActionListener, Cha private int pacmanx, pacmany; private int cycle; private boolean cycledir = true; - + Player player; ArrayList cells = new ArrayList(100000000); public CellPanel() @@ -49,6 +54,7 @@ public class CellPanel extends javax.swing.JPanel implements ActionListener, Cha //swingTimer.start(); pacmanx = 1050; pacmany = -20; + } @Override @@ -246,7 +252,19 @@ public class CellPanel extends javax.swing.JPanel implements ActionListener, Cha } else { kill = true; - swingTimer.setDelay(25); + + swingTimer.setDelay(10); + try { + FileInputStream fileInputStream = new FileInputStream("lib/pacman.mp3"); + Player player = new Player(fileInputStream); + player.play(); + } catch (FileNotFoundException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (JavaLayerException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } } }//GEN-LAST:event_jButton2ActionPerformed