Added sounds to coin pick up

Refactored check for token collision to move into the generic check for collision method
Created a YachtEventType enum to differentiate between collision and pickup on client side.
Client now plays a sound when they pick up a token

#story[1250]
This commit is contained in:
William Muir
2017-09-11 14:45:04 +12:00
parent 02e6d2a98b
commit 9fcb8915c2
5 changed files with 118 additions and 52 deletions
@@ -151,6 +151,16 @@ public class Sounds {
}
}
public static void playTokenPickupSound() {
if (!soundEffectsMuted) {
Media pickupSound = new Media(
Sounds.class.getClassLoader().getResource("sounds/Coin-pick-up-sound-effect.mp3")
.toString());
soundPlayer = new MediaPlayer(pickupSound);
soundPlayer.play();
}
}
public static void playHoverSound() {
if (!soundEffectsMuted) {
Media hoverSound = new Media(Sounds.class.getClassLoader().getResource("sounds/sound-over.wav").toString());