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 TypeMethodDescriptionboolean
void
draw
(float realDeltaTime) void
playExplosionSound
(float posX) void
playShotSound
(StaticSoundType soundType, Tower tower) void
playStatic
(StaticSoundType soundType) void
playStatic
(StaticSoundType soundType, float volume, float pitch, float pan) void
Произвести окончательную настройку системы.boolean
Нужно ли учитывать время выполнения update() в Debugvoid
setMusicPlaybackHandler
(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.void
setup()
Произвести начальную настройку системы.void
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().Methods inherited from class com.prineside.tdi2.GameSystem
dispose, getFastStateHash, postStateRestore, update
Methods 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:
profileUpdate
in classGameSystem
-
getSystemName
- Specified by:
getSystemName
in classGameSystem
-
affectsGameState
public boolean affectsGameState()- Specified by:
affectsGameState
in classGameSystem
-
setup
public void setup()Description copied from class:GameSystem
Произвести начальную настройку системы. На момент вызова этого метода, systemProvider содержит объекты всех систем.- Overrides:
setup
in classGameSystem
-
postSetup
public void postSetup()Description copied from class:GameSystem
Произвести окончательную настройку системы. Во время вызова, все системы загружены и установлены (setup()), все слушатели добавлены- Overrides:
postSetup
in 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
-