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

Animation Class Improvements #576

Closed
clintbellanger opened this issue Jul 12, 2012 · 1 comment
Closed

Animation Class Improvements #576

clintbellanger opened this issue Jul 12, 2012 · 1 comment
Labels

Comments

@clintbellanger
Copy link
Owner

Few classes should have to handle frame counting and resetting, image loading, etc. explicitly. Instead the Animation class should handle these cases.

Right now it's mainly geared towards different Entity animations. We should decouple that a bit.

  • Use an init() function instead of passing that ton of stuff in the constructor
  • Allow init() from parent, or loadAnimation() from file (especially for animations with single states)
  • Allow animations to load its own image, or allow the parent class to pass it in via ::setImage() (e.g. image shared between multiple Animations). Have a bool image_cleanup set in Animation::loadImage() so that the class knows whether to delete the SDL_Image memory later (otherwise leave it to the parent class).

Examples where we want to use it:

  • When the player levels up, put an animated icon over the Character and Powers menu to remind players of their new points.
  • On the Cut Scene game play state we could use simple animations for story frames.
  • Perhaps convert the TileSet class to use this for animated tiles.
  • Perhaps convert the Powers class to use these (could be nice to refer to an existing animation instead of having all the animation data inside the actual power definition)

Also, ideally, the class should support Starting and Ending frames, particularly for looped animations. The animation definition could specify which frames are the startup, then the middle is the loop, then the end frames. That way we could easily do many nice things:

  • When the hero starts running they can have a short (~4 frame) section where the take off to begin and slow down to end.
  • Missile spells could have a flash startup and an explosion on impact, without hacking in after-effect "powers".
stefanbeller added a commit to stefanbeller/flare that referenced this issue Aug 18, 2012
stefanbeller added a commit to stefanbeller/flare that referenced this issue Aug 24, 2012
This work is related to clintbellanger#576.
A more flexible animation class is required for clintbellanger#857 or probably
even for clintbellanger#719.
stefanbeller added a commit to stefanbeller/flare that referenced this issue Aug 24, 2012
This work is related to clintbellanger#576.
A more flexible animation class is required for clintbellanger#857 or probably
even for clintbellanger#719.
stefanbeller added a commit to stefanbeller/flare that referenced this issue Aug 25, 2012
This work is related to clintbellanger#576.
A more flexible animation class is required for clintbellanger#857 or probably
even for clintbellanger#719.
@stefanbeller
Copy link
Collaborator

Migrated to new repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants