The issue is more along the following lines:
class EnemyTracker
{
private:
std::vector<Enemy> _enemies;
public:
DrawEnemies(sf::RenderTarget& target)
{
for(unsigned int i = 0;i<_enemies.size();i++)
{
target.Draw(_enemies[i]);
}
}
};
class Enemy
{
public:
int _health,_xPos,_yPos;
};
class FastEnemy: public Enemy,sf::Sprite
{
private:
int _moveSpeed;
};
class BigEnemy: public Enemy,sf::Sprite
{
private:
int _size;
};
This is an example of the type of setup I am trying to design. Basically, each type of enemy has its own Sprite and logic, but I want to have a generic parent type so that I don't need to make a new container every time I create a new type of enemy. How can this be done in C++ while having access to SFML?