diff --git a/Projekte/battleship/client/src/main/java/pp/battleship/client/BackgroundMusic.java b/Projekte/battleship/client/src/main/java/pp/battleship/client/BackgroundMusic.java index 888d5231..bfc3c070 100644 --- a/Projekte/battleship/client/src/main/java/pp/battleship/client/BackgroundMusic.java +++ b/Projekte/battleship/client/src/main/java/pp/battleship/client/BackgroundMusic.java @@ -21,8 +21,8 @@ public class BackgroundMusic implements GameEventListener { private static final String MENU_MUSIC = "Music/MainMenu/Dark_Intro.ogg"; private static final String BATTLE_MUSIC = "Music/BattleTheme/boss_battle_#2_metal_loop.wav"; - private static final String GAME_OVER_MUSIC_L = "Music/GameOver/Lose.ogg"; - private static final String GAME_OVER_MUSIC_V = "Music/GameOver/Victory.wav"; + private static final String GAME_OVER_MUSIC_L = "Music/GameOver/Lose/Lose.ogg"; + private static final String GAME_OVER_MUSIC_V = "Music/GameOver/Victory/Victory.wav"; private final AudioNode menuMusic; private final AudioNode battleMusic; diff --git a/Projekte/battleship/client/src/main/java/pp/battleship/client/gui/ShipControl.java b/Projekte/battleship/client/src/main/java/pp/battleship/client/gui/ShipControl.java index 57631af9..fc39f53c 100644 --- a/Projekte/battleship/client/src/main/java/pp/battleship/client/gui/ShipControl.java +++ b/Projekte/battleship/client/src/main/java/pp/battleship/client/gui/ShipControl.java @@ -46,6 +46,16 @@ class ShipControl extends AbstractControl { */ private final Quaternion pitch = new Quaternion(); + /** + * the speed at which ships sink + */ + private static final float SINKING_SPEED = -0.05f; + + /** + * the threshold when ships should be removed from the scene if they sink below the value + */ + private static final float SHIP_SINKING_REMOVE_THRESHOLD = -0.6f; + /** * The current time within the oscillation cycle, used to calculate the ship's pitch angle. */ @@ -82,6 +92,7 @@ public ShipControl(Battleship ship) { /** * Updates the ship's pitch oscillation each frame. The ship's pitch is adjusted * to create a continuous tilting motion, simulating the effect of waves. + * And lets the ship sink if it is destroyed and removes it from the scene when it has completely sunk * * @param tpf time per frame (in seconds), used to calculate the new pitch angle */ @@ -90,11 +101,11 @@ protected void controlUpdate(float tpf) { // If spatial is null, do nothing if (spatial == null) return; - if (battleship.isDestroyed() && spatial.getLocalTranslation().getY() <= -0.6f) { + if (battleship.isDestroyed() && spatial.getLocalTranslation().getY() <= SHIP_SINKING_REMOVE_THRESHOLD) { LOGGER.log(Level.INFO, "Ship removed {0}", spatial.getName()); spatial.getParent().detachChild(spatial); } else if (battleship.isDestroyed()) { - spatial.move(0, -0.05f * tpf, 0); + spatial.move(0, SINKING_SPEED * tpf, 0); } else { // Update the time within the oscillation cycle time = (time + tpf) % cycle; diff --git a/Projekte/battleship/client/src/main/resources/Music/BattleTheme/README.txt b/Projekte/battleship/client/src/main/resources/Music/BattleTheme/README.txt new file mode 100644 index 00000000..aba6ced0 --- /dev/null +++ b/Projekte/battleship/client/src/main/resources/Music/BattleTheme/README.txt @@ -0,0 +1,3 @@ +based on +https://opengameart.org/content/boss-battle-2-symphonic-metal +License: CC0 (public domain) \ No newline at end of file diff --git a/Projekte/battleship/client/src/main/resources/Music/BattleTheme/boss_battle_#2_metal_opening.wav b/Projekte/battleship/client/src/main/resources/Music/BattleTheme/boss_battle_#2_metal_opening.wav deleted file mode 100644 index 13dafb6b..00000000 Binary files a/Projekte/battleship/client/src/main/resources/Music/BattleTheme/boss_battle_#2_metal_opening.wav and /dev/null differ diff --git a/Projekte/battleship/client/src/main/resources/Music/GameOver/Lose.ogg b/Projekte/battleship/client/src/main/resources/Music/GameOver/Lose/Lose.ogg similarity index 100% rename from Projekte/battleship/client/src/main/resources/Music/GameOver/Lose.ogg rename to Projekte/battleship/client/src/main/resources/Music/GameOver/Lose/Lose.ogg diff --git a/Projekte/battleship/client/src/main/resources/Music/GameOver/Lose/README.txt b/Projekte/battleship/client/src/main/resources/Music/GameOver/Lose/README.txt new file mode 100644 index 00000000..26a743ac --- /dev/null +++ b/Projekte/battleship/client/src/main/resources/Music/GameOver/Lose/README.txt @@ -0,0 +1,3 @@ +based on +https://opengameart.org/content/game-over-instrumental +License: CC0 (public domain) \ No newline at end of file diff --git a/Projekte/battleship/client/src/main/resources/Music/GameOver/Victory/README.txt b/Projekte/battleship/client/src/main/resources/Music/GameOver/Victory/README.txt new file mode 100644 index 00000000..ec15d350 --- /dev/null +++ b/Projekte/battleship/client/src/main/resources/Music/GameOver/Victory/README.txt @@ -0,0 +1,3 @@ +based on +https://opengameart.org/content/victory-fanfare-short +License: CC0 (public domain) \ No newline at end of file diff --git a/Projekte/battleship/client/src/main/resources/Music/GameOver/Victory.wav b/Projekte/battleship/client/src/main/resources/Music/GameOver/Victory/Victory.wav similarity index 100% rename from Projekte/battleship/client/src/main/resources/Music/GameOver/Victory.wav rename to Projekte/battleship/client/src/main/resources/Music/GameOver/Victory/Victory.wav diff --git a/Projekte/battleship/client/src/main/resources/Music/MainMenu/README.txt b/Projekte/battleship/client/src/main/resources/Music/MainMenu/README.txt new file mode 100644 index 00000000..37e2de41 --- /dev/null +++ b/Projekte/battleship/client/src/main/resources/Music/MainMenu/README.txt @@ -0,0 +1,3 @@ +based on +https://opengameart.org/content/dark-intro +License: CC0 (public domain) \ No newline at end of file