Aufgabe 10.

added class BackgroundMusic
edited BattleshipApp, GameSound, Menu
implemented a Slider for the Gui in order to change the Volume
Quality of Life
implemented feature to Safe the Sound settings to keep them even after shutting down the game
implemented feature to mute Sounds/effects
implemented feature to mute Music
This commit is contained in:
Lukas Bauer
2024-10-03 19:10:36 +02:00
parent ce490fb877
commit b2b3bc23bf

View File

@@ -19,8 +19,8 @@ public class BackgroundMusic {
/**
* Constuctor for the BackgroundMusic
* @param app
* @param musicFilePath
* @param app for synchronising and saving data with the application
* @param musicFilePath the filepath for the BackgroundMusic
*/
public BackgroundMusic(Application app, String musicFilePath) {
this.volume = prefs.getFloat(VOLUME_PREF, 1.0f);
@@ -69,7 +69,7 @@ public void toogleMusic() {
/**
* Setter for the Volume also safes the volume from the previous session
* @param volume
* @param volume variable for the volume of the BackgroundMusic
*/
public void setVolume(float volume) {
this.volume = volume;