SFML community forums

Help => Graphics => Topic started by: Coakie on December 18, 2016, 08:46:49 pm

Title: How to make a vector of circles?
Post by: Coakie on December 18, 2016, 08:46:49 pm
I'm trying to make a game in which a bunch of circles spawn and the "player" needs to eat them up. I figured that the best way to do this would be by using a vector, instead of defining them all individually. How do I do this?

I know that I need to do something like this:
        vector<sf::CircleShape> circles;
        circles.resize(10);

How do I add new circles in it, though; and how do I set the properties of the circles
Title: Re: How to make a vector of circles?
Post by: korczurekk on December 18, 2016, 08:52:23 pm
It's not really SFML-related problem, maybe like this (http://www.codeguru.com/cpp/cpp/cpp_mfc/stl/article.php/c4027/C-Tutorial-A-Beginners-Guide-to-stdvector-Part-1.htm)?
Title: Re: How to make a vector of circles?
Post by: Coakie on December 18, 2016, 09:07:29 pm
Oh, OK. Thanks