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

Implement FlxG.animationTimeScale #2937

Merged
merged 2 commits into from
Oct 14, 2023
Merged

Implement FlxG.animationTimeScale #2937

merged 2 commits into from
Oct 14, 2023

Conversation

DetectiveBaldi
Copy link
Contributor

@DetectiveBaldi DetectiveBaldi commented Oct 13, 2023

A more convenient way of setting global animation speeds.

Also adjusted FlxG.timeScale's initialization value to match the comment.

Fixes #2936

@@ -80,7 +80,12 @@ class FlxG
/**
* How fast or slow time should pass in the game; default is `1.0`.
*/
public static var timeScale:Float = 1;
public static var timeScale:Float = 1.0;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI 1.0 and 1 are functionally equivalent when typed to Float

Copy link
Contributor Author

@DetectiveBaldi DetectiveBaldi Oct 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I figured so, however it was a change done mostly for comment accuracy, and also due to FlxG.reset setting these values to 1.0 also.

Either way, should I revert this change?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need to revert, just saying that this change doesn't make it "more accurate" in any meaningful way

@Geokureli Geokureli merged commit ac6c89a into HaxeFlixel:dev Oct 14, 2023
16 checks passed
@Geokureli
Copy link
Member

Thanks!

@DetectiveBaldi DetectiveBaldi deleted the animationTimeScale branch October 14, 2023 01:27
@Geokureli Geokureli added this to the 5.5.0 milestone Jan 4, 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.

Making FlxAnimationController.timeScale static / adding a static variable for global animation speed.
2 participants