What I need to do is set it into a function (eg void Bonce('new shape') and input the name of a new shape as a parameter, so, in the case shown circ.setPosition(,x,y) would become 'new shape'.setPosition(x,,y).
Am I just being incredibly stupid or is this really as difficult as it seems?
Sorry if I did not explain my query very well. 'circ' is a member of a class in sfml which is constructed by using: sf::CircleShape circ(20), where circ is the name of this particular instance and (20) is the radius.
I can create further circles by using different names instead of 'circ'.
What I basically need is a method for passing a new name into a function, as described. The code I have shown above is, at present, inline and it is not a very good idea to have to repeat the whole code for each instance if, for instance, I wished to use 4 circles.
Any advice will be appreciated as I appear to have confused myself even more trying to work out how to do it!
sf::CircleShape circ(20); does, by syntax, construct a variable with name 'circ' and type 'sf::CircleShape'. The '20' is a value passed to the constructor. In the previous posts there are examples that have functions taking a latameter of type as a reference.
Andy I tried your suggestion . It certainly moves the shape but only once, not for a continuous movement like the inline code does. I printed out the x and y coordinates to check. I will carry on trying, at least you've given me a start.