Package com.prineside.tdi2.systems
Class SoundSystem
java.lang.Object
com.prineside.tdi2.Registrable
com.prineside.tdi2.GameSystem
com.prineside.tdi2.systems.SoundSystem
- All Implemented Interfaces:
Disposable,KryoSerializable
-
Field Summary
Fields inherited from class com.prineside.tdi2.Registrable
S -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanvoiddraw(float realDeltaTime) voidplayExplosionSound(float posX) voidplayShotSound(StaticSoundType soundType, Tower tower) voidplayStatic(StaticSoundType soundType) voidplayStatic(StaticSoundType soundType, float volume, float pitch, float pan) voidПроизвести окончательную настройку системы.booleanНужно ли учитывать время выполнения update() в DebugvoidsetMusicPlaybackHandler(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.voidsetup()Произвести начальную настройку системы.voidCalled 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().Methods inherited from class com.prineside.tdi2.GameSystem
dispose, getFastStateHash, postStateRestore, updateMethods inherited from class com.prineside.tdi2.Registrable
isRegistered, read, setRegistered, setUnregistered, write
-
Constructor Details
-
SoundSystem
public SoundSystem()
-
-
Method Details
-
profileUpdate
public boolean profileUpdate()Description copied from class:GameSystemНужно ли учитывать время выполнения update() в Debug- Overrides:
profileUpdatein classGameSystem
-
getSystemName
- Specified by:
getSystemNamein classGameSystem
-
affectsGameState
public boolean affectsGameState()- Specified by:
affectsGameStatein classGameSystem
-
setup
public void setup()Description copied from class:GameSystemПроизвести начальную настройку системы. На момент вызова этого метода, systemProvider содержит объекты всех систем.- Overrides:
setupin classGameSystem
-
postSetup
public void postSetup()Description copied from class:GameSystemПроизвести окончательную настройку системы. Во время вызова, все системы загружены и установлены (setup()), все слушатели добавлены- Overrides:
postSetupin classGameSystem
-
setMusicPlaybackHandler
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
-
playStatic
-
playExplosionSound
public void playExplosionSound(float posX) -
playStatic
-