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

Added fade helpers to help clean code in game objects #1641

Merged
merged 3 commits into from
Jan 17, 2021

Conversation

Semphriss
Copy link
Member

The FadeHelper will make it much easier to write fading code inside GameObjects and any update()-able class.

Note: This helper has yet to be used inside the code. A refactor would be needed. I can do this, but if you think this PR is a good idea, I would really appreciate your help :)

src/util/fade_helper.cpp Outdated Show resolved Hide resolved
src/util/fade_helper.hpp Outdated Show resolved Hide resolved
src/util/fade_helper.cpp Outdated Show resolved Hide resolved
(Repeating an internal discussion here) This kind of change is recommended when the body of the if statement is considered a special case of some sort. If both cases are considered equivalent in importance and complementary (say, an easing function that uses a certain body for values [0, 0.5[ and another for [0.5, 1]), then keeping the else is recommended so that the code *looks* like it gives equal importance to both parts.
@Zwatotem Zwatotem merged commit 53ccb93 into SuperTux:master Jan 17, 2021
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