pause and resume animations

This commit is contained in:
2023-05-12 10:48:51 -06:00
parent 165536e6bc
commit bced4a0693

View File

@@ -31,6 +31,13 @@
(method :Void pause []
(FlxG.inputs.remove actionManager)
(FlxG.state.forEach
->:Void child
(typeCase [child]
([:FlxSprite sprite]
(sprite.animation?.pause))
(otherwise))
true)
(doFor sound currentSounds
(sound.pause))
(doFor track currentVoiceTracks
@@ -46,6 +53,13 @@
(method :Void resume []
(FlxG.inputs.add actionManager)
(FlxG.state.forEach
->:Void child
(typeCase [child]
([:FlxSprite sprite]
(sprite.animation?.resume))
(otherwise))
true)
(resumeAndUpdateCurrentVolume currentSounds soundVolume)
(resumeAndUpdateCurrentVolume currentVoiceTracks voiceVolume)
(when music