0 Members and 1 Guest are viewing this topic.
Use a bool variable/array of bools to determine which aliens should be drawn and then just don't draw the alien that you want to remove from the screen.
EDIT: If you are using a single sprite for all the aliens, then that is basically pointless as it is easy enough to move them all simultaneously and sprites are lightweight.
sf::Texture alienTexture;sf::Sprite aliens[10];bool visible[10];alienTexture.loadFromFile("image.png");for(int i (0); i < 10; i = i + 1){ aliens[i].setTexture(alienTexture);}...for(int i (0); i < 10; i = i + 1){ if(visible[i]) { window.draw(aliens[i]); }}