Class SoundSystem

All Implemented Interfaces:
Disposable, KryoSerializable

public final class SoundSystem extends GameSystem
  • Constructor Details

    • SoundSystem

      public SoundSystem()
  • Method Details

    • profileUpdate

      public boolean profileUpdate()
      Description copied from class: GameSystem
      Should the update() method be rendered on the debug overlay
      Overrides:
      profileUpdate in class GameSystem
    • getSystemName

      public String getSystemName()
      Specified by:
      getSystemName in class GameSystem
    • affectsGameState

      public boolean affectsGameState()
      Specified by:
      affectsGameState in class GameSystem
    • setup

      public void setup()
      Description copied from class: GameSystem
      Performs the initial configuration of the system. At the moment of call, systemProvider already contains all objects of systems.
      Overrides:
      setup in class GameSystem
    • postSetup

      public void postSetup()
      Description copied from class: GameSystem
      Performs the final configuration of the system. At the moment of call, all systems are already loaded and setup(), all listeners are already added.
      Overrides:
      postSetup in class GameSystem
    • setMusicPlaybackHandler

      public void setMusicPlaybackHandler(@Null Runnable handler)
      Allows to override music playback handling (changing volume / stopping or starting the music etc) If handler is null, the default handler will be used. It is suggested to account for at least these conditions: - If SettingsManager.isMusicEnabled() is false, do not play any music (call MusicManager.stopMusic()) - If in pause and music list is not visible (S.gameState.isPaused() && !MusicListOverlay.i().isVisible()), reduce the volume (MusicManager.setVolume(0.25, 2, false))
    • updateMusicPlayback

      public void updateMusicPlayback()
      Called when: - Game paused or resumed - Sound system set up and post set up - Volume adjusted in pause - Music list overlay is shown / hidden during the game - Probably some other places in future This method can be overridden by a custom handler, see setMusicPlaybackHandler(). Default logic: - If wave is not started yet or music is disabled in settings (volume == 0), stops any music playing and returns - If map music is ignored, starts or continues to play menu music. If not, searches for a music tile and plays it - Sets to full volume if not paused or if music list overlay is visible. Sets to 25% volume otherwise (in pause and list is not visible)
    • draw

      public void draw(float realDeltaTime)
    • playShotSound

      public void playShotSound(StaticSoundType soundType, Tower tower)
    • playStatic

      public void playStatic(StaticSoundType soundType)
    • playExplosionSound

      public void playExplosionSound(float posX)
    • playStaticParameterized

      public void playStaticParameterized(StaticSoundType soundType, float volume, float pitch, float pan)