Thanks for the reply.
I went with option 2 as planned, it seemed straightforward, but i quickly ran into a problem.
So here's my hero class:
class Hero
{
public:
Hero (const sf::Texture & texture, float posX, float posY, int state );
Hero::~Hero();
void draw (sf::RenderWindow* window);
void move (int state);
void display(int state);
int getFrame();
void resetFrame();
void set();
int state;
private:
sf::Sprite m_sprite;
int position;
int frame;
};
ATM i'm doing the animation the standard way: using Rect on each frame, and drawing that frame in the loop.
It works nicely when there's only a few moves. But the problem is, main character's sprite sheet is pretty large. There are lot moves, and they are quite detailed, up to 20 frames per move. This means, they can't fit into one spritesheet.
So while this way of doing things is perfectly fine for background elements, or enemies with smaller pattern of moves, the hero class would need some changes.
I was wondering what the best course of action would be. Should i add more member sprites to the class, and switch them, depending on state ( running, attacking etc. )? That seems kinda clunky, since i would need to change which sprite gets drawn in main loop of the game.
Or should i just remove the member sprites, and just move on to option 3, leaving hero class with just data regarding positions and status, etc.?