First post one here :-)
I've been going through the SFML game dev book and so far I have learnt a lot. The one thing I am somewhat stuck on is the animation.
I am trying to make a platformer as an excuse to learn about all aspects of game making and the various systems necessary to make a game. Anyways, I have written an Animation class which is basically that used in the book with some minor alterations, you can see the vanilla Animation class here:
This is the class described in the book, but functionally it is the same as mine. Essentially you load a spritesheet which contains all the frames of the animation sequence and shift the drawn sprite along the sheet to create the illusion of motion, so far nothing particularly earth-shattering. The issue that I am having is in trying to implement multiple animated actions into my player character and enemy mobs.
Most tutorials deal with the drawing and animation mechanic itself but never really go into too much detail as to how one would manage different mobs/players with different animated actions in a smart way without resorting to tonnes of subclasses or some unweildy case handling.
I was wondering if anybody could share some of their wisdom regarding this issue