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

AnimatedSprite.Update(float) and AnimatedTilemap.Update(float) both assume milliseconds when it should be seconds #61

Closed
AristurtleDev opened this issue Feb 27, 2023 · 1 comment
Assignees
Labels
💥 Breaking Change This would constitute a breaking change and require a major version release 🐞 Bug A bug has been identified and need to be fixed. ✅ Status: Closed This issue or pull request is closed.
Milestone

Comments

@AristurtleDev
Copy link
Owner

Description

Both the AnimatedSprite.Update(float) and AnimatedTilemap.Update(float) functions have a parameter that expects the elapsed time in milliseconds. Using milliseconds is not a typical use case for delta time. Generally delta time is done in seconds.

Steps to Reproduce

The typical use case will use delta time as total seconds not total milliseconds

// Assume an AnimatedSprite was created during the LoadContent method

protected override void Update(GameTIme gameTime)
{
    float deltaTime = (float)gameTime.ElapsedGameTime.TotalSeconds;
    _animatedSprite.Update(deltaTime);    
}

Expected Behavior

It would be expected that the animated sprite updates accordingly using the common format of delta time being in seconds.

Actual Behavior

The animated sprite is not updated as expected since it assumes delta time in milliseconds.

Configuration

Not applicable

Other Information

No response

@AristurtleDev AristurtleDev added the 🆕 Status: New This issue or pull request is new and has not been looked at yet. label Feb 27, 2023
@AristurtleDev AristurtleDev self-assigned this Feb 27, 2023
@AristurtleDev AristurtleDev added this to the Version 5.0.0 milestone Feb 27, 2023
@AristurtleDev AristurtleDev added 🐞 Bug A bug has been identified and need to be fixed. 💥 Breaking Change This would constitute a breaking change and require a major version release labels Feb 27, 2023
AristurtleDev added a commit that referenced this issue Feb 27, 2023
@AristurtleDev
Copy link
Owner Author

This has been updated in the 4.0.4 release.

@AristurtleDev AristurtleDev added ✅ Status: Closed This issue or pull request is closed. and removed 🆕 Status: New This issue or pull request is new and has not been looked at yet. labels Feb 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💥 Breaking Change This would constitute a breaking change and require a major version release 🐞 Bug A bug has been identified and need to be fixed. ✅ Status: Closed This issue or pull request is closed.
Projects
None yet
Development

No branches or pull requests

1 participant