Mit Sound zum testen noch keine Loop für die Hintergrund Musik

This commit is contained in:
andreas
2014-12-09 16:30:23 +01:00
parent c53e9ef7e7
commit 031432f11b
3 changed files with 20 additions and 0 deletions
@@ -0,0 +1,14 @@
package de.heatup.audio;
public class SoundfileInvaders {
private String path;
public SoundfileInvaders() {
this.path = "src/de/heatup/resources/audio/" + "8bitinvaders.wav";
}
public String getPath() {
return this.path;
}
}
+6
View File
@@ -13,6 +13,8 @@ import java.awt.Point;
import javax.swing.JFrame;
import javax.swing.JPanel;
import de.heatup.audio.AudioPlayer;
import de.heatup.audio.SoundfileInvaders;
import de.heatup.cfg.Config;
import de.heatup.logging.Logger;
import de.heatup.mapengine.CollisionHandler;
@@ -126,6 +128,10 @@ public class Main extends JFrame implements Runnable {
gamePanel.setVisible(true);
actionPanel.setVisible(true);
statusPanel.setVisible(true);
SoundfileInvaders bgsound = new SoundfileInvaders();
AudioPlayer p = new AudioPlayer();
p.play(bgsound.getPath());
}