Hello, I was searching on the internet for my answer but I found nothing. All I want to make is Object that can move sf::Recrtangle or sf::Sprite. For example:
For example:
What should i add or change in my code to just move rectangle shape from movable class.Code:class Movable { private: std::string name; protected: Movable(std::string); public: void moveRight(int lenght); //to move rectangleshape from Rectangle class. }; class Rectangle : Movable { private: sf::RectangleShape rectangleshape; public: Rectangle(std::string rectangle_name) : Object(rectangle_name) {} }; int main() { Rectangle rectangle("name"); rectangle.moveRight(64); }




Reply With Quote
