Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Batch Async utils #3151

Open
Geokureli opened this issue May 28, 2024 · 0 comments
Open

Batch Async utils #3151

Geokureli opened this issue May 28, 2024 · 0 comments

Comments

@Geokureli
Copy link
Member

Geokureli commented May 28, 2024

FlxTweens have tween.then(otherTween) which allow chaining, but timers do not have anything like this. Would be nice to have batch timers like the one created for FNF by cyn0x8 in FunkinCrew/Funkin#2391.

Even more so it would be nice if there was an interface or protocol shared by FlxTimer, FlxTween or any other async event that allowed them to be laid out in a single sequence, I.E.

new FlxSequence
(
    [
        FlxTween.tween(obj, {x: targetX }, 2.5, obj.doThing),
        FlxTween.flicker(1.0),// no callback
        FlxTween.tween(obj, {x: targetX }, 2.5, obj.doThing),
        FlxTimer().wait(1.0, doThing2),
        FlxG.camera.shake(0.05, 0.5),
        obj.startAsyncProcess(1.0)
    ],
    onSequenceComplete
)

the above would run each process in sequence, and then call onSequenceComplete

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant