Merge branch 'develop' into Story1248_Game_App_Scaling

This commit is contained in:
William Muir
2017-09-11 16:56:49 +12:00
6 changed files with 15 additions and 7 deletions
@@ -322,8 +322,8 @@ public class GameState implements Runnable {
checkPowerUpTimeout(yacht);
yacht.runAutoPilot();
yacht.updateLocation(timeInterval);
if (yacht.getBoatStatus() != BoatStatus.FINISHED) {
checkCollision(yacht);
if (yacht.getBoatStatus() != BoatStatus.FINISHED) {
checkForLegProgression(yacht);
raceFinished = false;
}
@@ -403,7 +403,6 @@ public class GameState implements Runnable {
serverYacht.setLocation(
calculateBounceBack(serverYacht, originalLocation, BOUNCE_DISTANCE_YACHT)
);
System.out.println("DID BOUNCE BACK");
serverYacht.setCurrentVelocity(
serverYacht.getCurrentVelocity() * COLLISION_VELOCITY_PENALTY
);
@@ -424,7 +423,6 @@ public class GameState implements Runnable {
calculateBounceBack(serverYacht, collidedMark, BOUNCE_DISTANCE_MARK)
);
System.out.println("DID BOUNCE BACK2");
serverYacht.setCurrentVelocity(
serverYacht.getCurrentVelocity() * COLLISION_VELOCITY_PENALTY
);
@@ -440,7 +438,6 @@ public class GameState implements Runnable {
BOUNCE_DISTANCE_YACHT)
);
System.out.println("DID BOUNCE BACK3");
serverYacht.setCurrentVelocity(
serverYacht.getCurrentVelocity() * COLLISION_VELOCITY_PENALTY
);
@@ -191,7 +191,7 @@ public class MainServerThread implements Runnable, ClientConnectionDelegate {
GameState.spawnNewToken();
broadcastMessage(MessageFactory.getRaceXML());
}
}, 0, 60000);
}, 10000, 60000);
}
/**
+13 -2
View File
@@ -14,8 +14,9 @@ public class Sounds {
private static MediaPlayer musicPlayer;
private static MediaPlayer soundEffect;
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 soundEffectsMuted = false;
@@ -168,7 +169,17 @@ public class Sounds {
public static void playHoverSound() {
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();
}
}
Binary file not shown.
Binary file not shown.