HaxeFlixel / HaxeFlixel/flixel

Batch Async utils

Open
#3,151 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

New Feature
Dominant language
Haxe
Stars
2.2k
Forks
522
Avg merge
34m
Merged PRs (30d)
1

Description

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 https://github.com/FunkinCrew/Funkin/pull/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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the existing FlxTween chaining behavior and the FlxTimer API, then compare the batch timer implementation in Funkin pull request 2391. Define how a shared sequence would represent completion, callbacks, and async events such as tweens, timers, camera shake, and user processes. Done means a documented, consistent sequencing interface that supports the examples and invokes the completion callback at the end.

Written by the indexing model from the issue text.

Assessment

Domain
game-dev
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.