Hello! I'm new to SFML and I try to create a game 2048. So, I create a class, that have a function to create and draw rectangle with:
sf::RectangleShape rect(sf::Vector2f(130.f, 130.f));
rect.move(20.f, 20.f);
rect.setFillColor(sf::Color(255, 160, 122));
window.draw(rect);
But if I need to create two or more objects of this class, it will not work correctly because it create and draw one rectangle with one name. So, can I create a class, that will give an unique name for all rectangles and how?
And sorry for my english.