Skip to content
Snippets Groups Projects
Commit 91f96311 authored by Gehrung Jonas's avatar Gehrung Jonas
Browse files

UPDATE: one-time SoundEffects are running now

parent 689ea914
Loading
......@@ -14,9 +14,14 @@ public class SoundEffects {
}
public void playSoundEffectOnce(SFX soundEffect){
String path = soundEffect.getPath();
String resource = path.substring(18); // Begins at Ressource Folder
AudioClip audioClip = new AudioClip(getClass().getResource(resource).toExternalForm());
String path = soundEffect.getPath();
String resource = path.substring(18); // Begins at Ressource Folder
Thread sfx = new Thread(()->{
AudioClip audioClip = new AudioClip(getClass().getResource(resource).toExternalForm());
audioClip.play();
});
sfx.setDaemon(true);
sfx.start();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment