Package de.tum.cit.fop.maze
Class SoundController
java.lang.Object
de.tum.cit.fop.maze.SoundController
Manages game sound effects and music.
It handles loading, playing, and disposing of audio resources.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddispose()Disposes of all audio resources to prevent memory leaks.voidplayBackgroundMusic(float volume) Plays the background music.voidplayBackgrounStorydMusic(float volume) Plays the background story music.voidplayEnemyDieSound(float volume) Plays the enemy death sound.voidplayEnemyHitSound(float volume) Plays the enemy hit sound.voidplayKeyPickupSound(float volume) Plays the key pickup sound.voidplayMainMenuMusic(float volume) Plays the main menu music.voidplayPlayerDashSound(float volume) Plays the player dash sound.voidplayPlayerDieSound(float volume) Plays the player death sound.voidplayPlayerHealSound(float volume) Plays the player heal sound.voidplayPlayerHitSound(float volume) Plays the player hit sound.voidplaySteppingSound(float volume) Plays the stepping sound (looped).voidplayTouristRunSound(float volume) Plays the tourist run sound.voidplayUI_buttonClickSound(float volume) Plays the UI button click sound.voidplayUI_hoverOverSound(float volume) Plays the UI hover over sound.voidplayWinSound(float volume) Plays the win sound.voidStops the background music.voidStops the background story music.voidStops the main menu music.voidStops the stepping sound.
-
Constructor Details
-
SoundController
public SoundController()Creates a new SoundController and loads all audio files.
-
-
Method Details
-
playBackgroundMusic
public void playBackgroundMusic(float volume) Plays the background music.- Parameters:
volume- The volume level (0.0 to 1.0).
-
stopBackgroundMusic
public void stopBackgroundMusic()Stops the background music. -
playBackgrounStorydMusic
public void playBackgrounStorydMusic(float volume) Plays the background story music.- Parameters:
volume- The volume level.
-
stopBackgroundStoryMusic
public void stopBackgroundStoryMusic()Stops the background story music. -
playMainMenuMusic
public void playMainMenuMusic(float volume) Plays the main menu music.- Parameters:
volume- The volume level.
-
stopMainMenuMusic
public void stopMainMenuMusic()Stops the main menu music. -
playEnemyDieSound
public void playEnemyDieSound(float volume) Plays the enemy death sound.- Parameters:
volume- The volume level.
-
playEnemyHitSound
public void playEnemyHitSound(float volume) Plays the enemy hit sound.- Parameters:
volume- The volume level.
-
playKeyPickupSound
public void playKeyPickupSound(float volume) Plays the key pickup sound.- Parameters:
volume- The volume level.
-
playPlayerDashSound
public void playPlayerDashSound(float volume) Plays the player dash sound.- Parameters:
volume- The volume level.
-
playPlayerDieSound
public void playPlayerDieSound(float volume) Plays the player death sound.- Parameters:
volume- The volume level.
-
playPlayerHealSound
public void playPlayerHealSound(float volume) Plays the player heal sound.- Parameters:
volume- The volume level.
-
playPlayerHitSound
public void playPlayerHitSound(float volume) Plays the player hit sound.- Parameters:
volume- The volume level.
-
playSteppingSound
public void playSteppingSound(float volume) Plays the stepping sound (looped).- Parameters:
volume- The volume level.
-
stopSteppingSound
public void stopSteppingSound()Stops the stepping sound. -
playTouristRunSound
public void playTouristRunSound(float volume) Plays the tourist run sound.- Parameters:
volume- The volume level.
-
playUI_buttonClickSound
public void playUI_buttonClickSound(float volume) Plays the UI button click sound.- Parameters:
volume- The volume level.
-
playUI_hoverOverSound
public void playUI_hoverOverSound(float volume) Plays the UI hover over sound.- Parameters:
volume- The volume level.
-
playWinSound
public void playWinSound(float volume) Plays the win sound.- Parameters:
volume- The volume level.
-
dispose
public void dispose()Disposes of all audio resources to prevent memory leaks.
-