mirror of
https://github.com/michaelrausch/Party-Parrots-At-Sea.git
synced 2026-05-09 14:28:43 +00:00
Merge remote-tracking branch 'origin/develop' into develop
This commit is contained in:
@@ -14,8 +14,9 @@ public class Sounds {
|
|||||||
private static MediaPlayer musicPlayer;
|
private static MediaPlayer musicPlayer;
|
||||||
private static MediaPlayer soundEffect;
|
private static MediaPlayer soundEffect;
|
||||||
private static MediaPlayer soundPlayer;
|
private static MediaPlayer soundPlayer;
|
||||||
private static AudioClip hoverSoundPlayer = new AudioClip(Sounds.class.getClassLoader().getResource("sounds/sound-over.wav").toExternalForm());;
|
private static MediaPlayer hoverSoundPlayer;
|
||||||
|
|
||||||
|
private static boolean hoverInitialized = false;
|
||||||
private static boolean musicMuted = false;
|
private static boolean musicMuted = false;
|
||||||
private static boolean soundEffectsMuted = false;
|
private static boolean soundEffectsMuted = false;
|
||||||
|
|
||||||
@@ -168,7 +169,17 @@ public class Sounds {
|
|||||||
|
|
||||||
public static void playHoverSound() {
|
public static void playHoverSound() {
|
||||||
if (!soundEffectsMuted) {
|
if (!soundEffectsMuted) {
|
||||||
hoverSoundPlayer.setVolume(2.5);
|
if (!hoverInitialized) {
|
||||||
|
Media crashSound = new Media(
|
||||||
|
Sounds.class.getClassLoader().getResource("sounds/Error-sound-effect.mp3")
|
||||||
|
.toString());
|
||||||
|
hoverSoundPlayer = new MediaPlayer(crashSound);
|
||||||
|
hoverInitialized = true;
|
||||||
|
}
|
||||||
|
hoverSoundPlayer.setVolume(0.5);
|
||||||
|
if (hoverSoundPlayer != null) {
|
||||||
|
hoverSoundPlayer.stop();
|
||||||
|
}
|
||||||
hoverSoundPlayer.play();
|
hoverSoundPlayer.play();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user