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

Allow sprite animations to continue each other #1558

Merged
merged 1 commit into from
Oct 21, 2020
Merged

Allow sprite animations to continue each other #1558

merged 1 commit into from
Oct 21, 2020

Conversation

Semphriss
Copy link
Member

@Semphriss Semphriss commented Oct 20, 2020

Fixes #1462

Added family-name property to sprites.

Family names are a way for the game to identify sprites that continue each other; when switching between actions with the same family name, animations won't reset.


Technical details

Add an optional property called "family-name" for all sprite actions. For a given sprite, switching between actions with the same family name will remember "progress" in the animation. This will prevent resetting the animation, for example, when flipped.

If the property is absent, the game will assign family names automatically based on links created by the mirror_action and clone_action properties. That means if you have an action, plus another action which is a mirror of the first one, plus another which is a clone of either the first or the second, they will all share the same family name.

Result:

  • Two actions with the same family name will make both actions continue (aka not reset) when switching from one to another directly.
  • Two actions with different family names or without family names will make animations reset when switching form one to another.
  • A mirrored or cloned action without a family name that links to an action without a family name will make the game create a random family name and assign the same to both. (as if they both had the same family name)
  • A mirrored or cloned action without a family name that links to an action with a family name will make the mirrored action inherit its linked action's family name. (the mirrored/cloned action will have the same family name as its parent)
  • A mirrored or cloned action with a family name that links to an action without a family name will make both actions have different family names, and therefore will cancel the effect of this proposal.

Family names are a way for the game to identify sprites that continue each other; when switching between actions with the same family name, animations won't reset.
@weluvgoatz weluvgoatz merged commit 4e51e91 into SuperTux:master Oct 21, 2020
@Alzter
Copy link
Member

Alzter commented Oct 23, 2020

Awesome work!

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.

Sprite animation flipping
3 participants