fixed sound handling bug
This commit is contained in:
@@ -30,7 +30,8 @@ public class GamePanel extends JPanel implements Runnable {
|
||||
// SYSTEM
|
||||
TileManager tileM = new TileManager(this);
|
||||
KeyHandler keyH = new KeyHandler();
|
||||
Sound sound = new Sound();
|
||||
Sound se = new Sound();
|
||||
Sound music = new Sound();
|
||||
Thread gameThread;
|
||||
public CollisionHandler collisionH = new CollisionHandler(this);
|
||||
public AssetSetter assetSetter = new AssetSetter(this);;
|
||||
@@ -102,18 +103,18 @@ public class GamePanel extends JPanel implements Runnable {
|
||||
}
|
||||
|
||||
public void playMusic(int i) {
|
||||
sound.setFile(i);
|
||||
sound.play();
|
||||
sound.loop();
|
||||
music.setFile(i);
|
||||
music.play();
|
||||
music.loop();
|
||||
}
|
||||
|
||||
public void stopMusic() {
|
||||
sound.stop();
|
||||
music.stop();
|
||||
}
|
||||
|
||||
public void playSE(int i) {
|
||||
sound.setFile(i);
|
||||
sound.play();
|
||||
se.setFile(i);
|
||||
se.play();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user