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

Make SFML example with globalClock.restart() extend globalClock.getElapsedTime() #73

Merged
merged 2 commits into from
Aug 4, 2020
Merged

Conversation

DmitruMoth
Copy link
Contributor

No description provided.

@fallahn
Copy link
Owner

fallahn commented Aug 4, 2020

Thanks for the contribution!

}
tile.ID = itr->tileID;
if(itr == as.animTile.animation.frames.end() - 1)
time = 0;
Copy link
Contributor

@ldornbusch ldornbusch Aug 4, 2020

Choose a reason for hiding this comment

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

by setting this static var to zero.. you are resetting all tile animations (if there are multiple)?

Copy link
Owner

Choose a reason for hiding this comment

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

Indeed, I've addressed that here

Copy link
Contributor

Choose a reason for hiding this comment

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

Do you know what was the original problem with Clock.getElapsedTime() ?

Copy link
Owner

Choose a reason for hiding this comment

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

Personally I haven't worked much on the SFML example, it has mostly been updated by contributors, so I don't know. Perhaps @DmitruMoth can expand either here or on #72 and comment on whether or not this fixes the problem?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think it is not very convenient using getElapsedTime, because the time variable will be always grow up, so, my solution is bad, I just suggested

Copy link
Owner

Choose a reason for hiding this comment

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

I agree that using restart to get discrete time slices (fixed or otherwise) is, in my experience at least, a more common technique so I see your point of view. If the example works in its current state for everyone I have no problem with that.

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

Successfully merging this pull request may close these issues.

None yet

3 participants