You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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".
The text was updated successfully, but these errors were encountered:
Migrated from clintbellanger/flare#576
Originally opened by @clintbellanger
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.
Examples where we want to use it:
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:
The text was updated successfully, but these errors were encountered: