Hi Infinity Squared Software
Though I donĀ“t know much about C++, I think this concerns more to the SFML library, precisely to the signature of the draw() method (or function). It returns nothing and it takes a 'drawable' such as RectangleShape or a Sprite. Then you shouldn't pass as an argument an object of the class Enemy.
You could add to that class an atribute or member that is 'drawable' and load into it the shape you want to be displayed and call draw() with that Enemy object's member as the argument. Something like this:
window.draw(enemyOne.image);
(I'm not sure if it is as above or: window.draw(enemyOne->image) )
beeing 'image' a class Enemy member of any 'drawable' type
Respecting to the repetition of code, i suggest, as Jesper Juhl said, to use loops (for, while), and matrices (or vectors, or arrays) with them; I try to write an example: (let's suppose the Enemy class constructor recieves to ints)
int vector[][] = new int[5][2] {{34,21},{53,82},{27,36},{14,45},{31,63}};
int a;
Enemy enemies[] = new Enemy[5]; /* replace the magic number */
for (a = 0; a < 5; a++)
enemies[a] = new Enemy(vector[a][0], vector[a][1]);
then you could display the 5 enemies as below (in real life there would be many more):
for (a = 0; a < 5; a++)
window.draw(enemies[a].image);
supposing you have declared before into
class Enemy {
public:
Enemy:Enemy(int a, int b)
{
.....
}
sf::RectangleShape image;
....
}
Something I don't know if you have already done is the class Enemy logic (movement, attack, destruction, etc)
I can't help you with C++, but perhaps you would like to review some issues about it, such as loops, vectors o matrices (arrays), ... and i suppose what concerns to class structure, pointers, ... etc
what i tried to illustrate for you are alghoritms, a logical piece of code that helps us to do what we need (more efficiently), they are neutral to every language. About them, perhaps i can help you further ... i'm afraid C++ not
good luck!
Pablo
Bs As - Argentina