i’ve been building a game in SFML C++, i created the window, created the main character, who is a green circle. Now i’m creating 5 red circles, they are the enemies. My main idea is create the 5 circles one under the other with 100.f separation, so i use a for loop, and a pos auto incremented 100 in 100 for 5 times.
window.clear();
window.draw(shape);
for(i=0; i<n; i++){
pos=pos+100;
enemy.setPosition(100,pos);
window.draw(enemy);
}
window.display();
window.draw(shape), shape is the main character it doesn’t matter that
and the for loop, pos is auto incremented, sets the enemy y position, and draw it, 5 times
then window.display()
My problem is that the program draws the 5 circles but they disappear instantly