everybody. I need to add animations to my game. And I have a question.
I found AnimatedSprite class on SFML Github which is an inheritance, but in my project, I am using a lot of elements made with strategy pattern, for example movement behavior, jumping behavior, fighting behavior, etc. I just try to avoid inheritance because it makes class inflexible.
But this time in contrast to other classes Animation class has a lot of methods that can be used at runtime. I mean Play(), Stop(), Pause(), and more. If I use this as a strategy I would have to give access to this object.
What do you think? Maybe I just need to use another design pattern?