I had been doing this in arrays and was working completely fine but when I tried to do the same thing with vector I am getting errors.
error: 'class std::vector<sf::CircleShape>' has no member named 'setRadius' and 'setFillColor'
In food.h :
class Food{
private:
std::vector<sf::CircleShape> food[81];
public:
Food(int rad);
};
In food.cpp:
#include "food.h"
Food::Food(int rad){
for(int i=0;i<81;i++){
food[i].setRadius(rad);
food[i].setFillColor(sf::Color(10,200,10));
}
}