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:
@@ -19,8 +19,8 @@ public class BackgroundMusic {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Constuctor for the BackgroundMusic
|
* Constuctor for the BackgroundMusic
|
||||||
* @param app
|
* @param app for synchronising and saving data with the application
|
||||||
* @param musicFilePath
|
* @param musicFilePath the filepath for the BackgroundMusic
|
||||||
*/
|
*/
|
||||||
public BackgroundMusic(Application app, String musicFilePath) {
|
public BackgroundMusic(Application app, String musicFilePath) {
|
||||||
this.volume = prefs.getFloat(VOLUME_PREF, 1.0f);
|
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
|
* 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) {
|
public void setVolume(float volume) {
|
||||||
this.volume = volume;
|
this.volume = volume;
|
||||||
|
|||||||
Reference in New Issue
Block a user