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

Add FlxTimer.wait and FlxTimer.loop #3040

Merged
merged 5 commits into from
Feb 24, 2024
Merged

Conversation

Geokureli
Copy link
Member

@Geokureli Geokureli commented Feb 21, 2024

Rather than doing

var timer = new FlxTimer().start(duration, (timer:FlxTimer)->onTimerComplete());

can do

var timer = FlxTimer.wait(duration, onTimerComplete);

similarly instead of

var timer = new FlxTimer().start(duration, (timer:FlxTimer)->trace('${timer.elapsedLoops} loops'), 10);

can do

FlxTimer.loop(duration, (loops:Int)->trace('$loops loops'), 10);

@Geokureli Geokureli changed the title Add FlxTimer.wait Add FlxTimer.wait and FlxTimer.loop Feb 23, 2024
@Geokureli Geokureli merged commit c90b25a into HaxeFlixel:dev Feb 24, 2024
12 of 16 checks passed
@Geokureli Geokureli deleted the wait branch February 24, 2024 03:50
Geokureli added a commit that referenced this pull request Feb 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant