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:
@@ -1,5 +1,6 @@
|
|||||||
package seng302.utilities;
|
package seng302.utilities;
|
||||||
|
|
||||||
|
import javafx.scene.media.AudioClip;
|
||||||
import javafx.scene.media.Media;
|
import javafx.scene.media.Media;
|
||||||
import javafx.scene.media.MediaPlayer;
|
import javafx.scene.media.MediaPlayer;
|
||||||
|
|
||||||
@@ -13,6 +14,7 @@ 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 boolean musicMuted = false;
|
private static boolean musicMuted = false;
|
||||||
private static boolean soundEffectsMuted = false;
|
private static boolean soundEffectsMuted = false;
|
||||||
@@ -72,11 +74,12 @@ public class Sounds {
|
|||||||
Media raceMusic = new Media(Sounds.class.getClassLoader().getResource("sounds/Music-loop-120-bpm.mp3").toString());
|
Media raceMusic = new Media(Sounds.class.getClassLoader().getResource("sounds/Music-loop-120-bpm.mp3").toString());
|
||||||
musicPlayer = new MediaPlayer(raceMusic);
|
musicPlayer = new MediaPlayer(raceMusic);
|
||||||
musicPlayer.setCycleCount(MediaPlayer.INDEFINITE);
|
musicPlayer.setCycleCount(MediaPlayer.INDEFINITE);
|
||||||
|
musicPlayer.setVolume(0.3);
|
||||||
musicPlayer.play();
|
musicPlayer.play();
|
||||||
raceMusic = new Media(Sounds.class.getClassLoader().getResource("sounds/Sounds-of-the-ocean.mp3").toString());
|
raceMusic = new Media(Sounds.class.getClassLoader().getResource("sounds/Sounds-of-the-ocean.mp3").toString());
|
||||||
soundEffect = new MediaPlayer(raceMusic);
|
soundEffect = new MediaPlayer(raceMusic);
|
||||||
soundEffect.setCycleCount(MediaPlayer.INDEFINITE);
|
soundEffect.setCycleCount(MediaPlayer.INDEFINITE);
|
||||||
// soundEffect.setVolume(0.3);
|
soundEffect.setVolume(0.3);
|
||||||
soundEffect.play();
|
soundEffect.play();
|
||||||
musicPlayer.setMute(musicMuted);
|
musicPlayer.setMute(musicMuted);
|
||||||
soundEffect.setMute(soundEffectsMuted);
|
soundEffect.setMute(soundEffectsMuted);
|
||||||
@@ -87,6 +90,7 @@ public class Sounds {
|
|||||||
Sounds.class.getClassLoader().getResource("sounds/Elevator-music.mp3").toString());
|
Sounds.class.getClassLoader().getResource("sounds/Elevator-music.mp3").toString());
|
||||||
musicPlayer = new MediaPlayer(menuMusic);
|
musicPlayer = new MediaPlayer(menuMusic);
|
||||||
musicPlayer.setCycleCount(MediaPlayer.INDEFINITE);
|
musicPlayer.setCycleCount(MediaPlayer.INDEFINITE);
|
||||||
|
musicPlayer.setVolume(0.3);
|
||||||
musicPlayer.play();
|
musicPlayer.play();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -95,6 +99,7 @@ public class Sounds {
|
|||||||
Media finishMusic = new Media(Sounds.class.getClassLoader().getResource("sounds/Happy-birthday-song.mp3").toString());
|
Media finishMusic = new Media(Sounds.class.getClassLoader().getResource("sounds/Happy-birthday-song.mp3").toString());
|
||||||
musicPlayer = new MediaPlayer(finishMusic);
|
musicPlayer = new MediaPlayer(finishMusic);
|
||||||
musicPlayer.setCycleCount(MediaPlayer.INDEFINITE);
|
musicPlayer.setCycleCount(MediaPlayer.INDEFINITE);
|
||||||
|
musicPlayer.setVolume(0.3);
|
||||||
musicPlayer.play();
|
musicPlayer.play();
|
||||||
musicPlayer.setMute(musicMuted);
|
musicPlayer.setMute(musicMuted);
|
||||||
}
|
}
|
||||||
@@ -105,6 +110,7 @@ public class Sounds {
|
|||||||
Sounds.class.getClassLoader().getResource("sounds/Button-click-sound.mp3")
|
Sounds.class.getClassLoader().getResource("sounds/Button-click-sound.mp3")
|
||||||
.toString());
|
.toString());
|
||||||
soundPlayer = new MediaPlayer(buttonClick);
|
soundPlayer = new MediaPlayer(buttonClick);
|
||||||
|
soundPlayer.setVolume(0.5);
|
||||||
soundPlayer.play();
|
soundPlayer.play();
|
||||||
soundPlayer.setMute(soundEffectsMuted);
|
soundPlayer.setMute(soundEffectsMuted);
|
||||||
}
|
}
|
||||||
@@ -116,6 +122,7 @@ public class Sounds {
|
|||||||
Sounds.class.getClassLoader().getResource("sounds/Sms-notification.mp3")
|
Sounds.class.getClassLoader().getResource("sounds/Sms-notification.mp3")
|
||||||
.toString());
|
.toString());
|
||||||
soundPlayer = new MediaPlayer(finishSound);
|
soundPlayer = new MediaPlayer(finishSound);
|
||||||
|
soundPlayer.setVolume(0.5);
|
||||||
soundPlayer.play();
|
soundPlayer.play();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -123,7 +130,6 @@ public class Sounds {
|
|||||||
|
|
||||||
public static void playMarkRoundingSound() {
|
public static void playMarkRoundingSound() {
|
||||||
if (!soundEffectsMuted) {
|
if (!soundEffectsMuted) {
|
||||||
|
|
||||||
Media markRoundingSound = new Media(
|
Media markRoundingSound = new Media(
|
||||||
Sounds.class.getClassLoader().getResource("sounds/sms-tone.mp3").toString());
|
Sounds.class.getClassLoader().getResource("sounds/sms-tone.mp3").toString());
|
||||||
soundPlayer = new MediaPlayer(markRoundingSound);
|
soundPlayer = new MediaPlayer(markRoundingSound);
|
||||||
@@ -133,7 +139,6 @@ public class Sounds {
|
|||||||
|
|
||||||
public static void playCapGunSound() {
|
public static void playCapGunSound() {
|
||||||
if (!soundEffectsMuted) {
|
if (!soundEffectsMuted) {
|
||||||
|
|
||||||
Media gunSound = new Media(
|
Media gunSound = new Media(
|
||||||
Sounds.class.getClassLoader().getResource("sounds/Gunshot-sound.mp3").toString());
|
Sounds.class.getClassLoader().getResource("sounds/Gunshot-sound.mp3").toString());
|
||||||
soundPlayer = new MediaPlayer(gunSound);
|
soundPlayer = new MediaPlayer(gunSound);
|
||||||
@@ -163,9 +168,8 @@ public class Sounds {
|
|||||||
|
|
||||||
public static void playHoverSound() {
|
public static void playHoverSound() {
|
||||||
if (!soundEffectsMuted) {
|
if (!soundEffectsMuted) {
|
||||||
Media hoverSound = new Media(Sounds.class.getClassLoader().getResource("sounds/sound-over.wav").toString());
|
hoverSoundPlayer.setVolume(2.5);
|
||||||
soundPlayer = new MediaPlayer(hoverSound);
|
hoverSoundPlayer.play();
|
||||||
soundPlayer.play();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user