mirror of
https://github.com/michaelrausch/Party-Parrots-At-Sea.git
synced 2026-05-09 06:18:44 +00:00
Merge branch 'develop' into Story1274_custom_boat_stats
This commit is contained in:
@@ -14,8 +14,10 @@ public class Sounds {
|
|||||||
private static MediaPlayer soundEffect;
|
private static MediaPlayer soundEffect;
|
||||||
private static MediaPlayer soundPlayer;
|
private static MediaPlayer soundPlayer;
|
||||||
private static MediaPlayer hoverSoundPlayer;
|
private static MediaPlayer hoverSoundPlayer;
|
||||||
|
private static MediaPlayer crashSoundPlayer;
|
||||||
|
|
||||||
private static boolean hoverInitialized = false;
|
private static boolean hoverInitialized = false;
|
||||||
|
private static boolean crashInitialized = false;
|
||||||
private static boolean musicMuted = false;
|
private static boolean musicMuted = false;
|
||||||
private static boolean soundEffectsMuted = false;
|
private static boolean soundEffectsMuted = false;
|
||||||
|
|
||||||
@@ -155,11 +157,17 @@ public class Sounds {
|
|||||||
|
|
||||||
public static void playCrashSound() {
|
public static void playCrashSound() {
|
||||||
if (!soundEffectsMuted) {
|
if (!soundEffectsMuted) {
|
||||||
Media crashSound = new Media(
|
if (!crashInitialized) {
|
||||||
Sounds.class.getClassLoader().getResource("sounds/Large-metal-door-slam.mp3")
|
Media pickupSound = new Media(
|
||||||
.toString());
|
Sounds.class.getClassLoader().getResource("sounds/Large-metal-door-slam.mp3")
|
||||||
soundPlayer = new MediaPlayer(crashSound);
|
.toString());
|
||||||
soundPlayer.play();
|
crashSoundPlayer = new MediaPlayer(pickupSound);
|
||||||
|
crashInitialized = true;
|
||||||
|
}
|
||||||
|
if (crashSoundPlayer != null) {
|
||||||
|
crashSoundPlayer.stop();
|
||||||
|
}
|
||||||
|
crashSoundPlayer.play();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -176,10 +184,10 @@ public class Sounds {
|
|||||||
public static void playHoverSound() {
|
public static void playHoverSound() {
|
||||||
if (!soundEffectsMuted) {
|
if (!soundEffectsMuted) {
|
||||||
if (!hoverInitialized) {
|
if (!hoverInitialized) {
|
||||||
Media crashSound = new Media(
|
Media hoverSound = new Media(
|
||||||
Sounds.class.getClassLoader().getResource("sounds/Error-sound-effect.mp3")
|
Sounds.class.getClassLoader().getResource("sounds/Error-sound-effect.mp3")
|
||||||
.toString());
|
.toString());
|
||||||
hoverSoundPlayer = new MediaPlayer(crashSound);
|
hoverSoundPlayer = new MediaPlayer(hoverSound);
|
||||||
hoverInitialized = true;
|
hoverInitialized = true;
|
||||||
}
|
}
|
||||||
hoverSoundPlayer.setVolume(0.5);
|
hoverSoundPlayer.setVolume(0.5);
|
||||||
|
|||||||
Reference in New Issue
Block a user