Currently I'm stuck at one point, I'm trying to write something like this:
class Rectangle : public Movable {
private:
sf::RectangleShape rs;
public:
Rectangle() {}
};
class Circle : public Movable {
private:
sf::CircleShape cs;
public:
Circle() {}
};
//CLASS THAT WILL GIVE ABILITY TO MOVE ALL TYPES OF MOVABLE CLASSES.
class Movable {
public:
void move(float, float);
};
All I ask is if someone can write me a code with class that will enable all classes (rectangle, circle) to have ability to move their RectangleShape/CircleShape. And by the time I will learn how and why. I tried with virtual functions but it doesn't do what I want (or maybe idk how to use it). I would be so pleasant if someone could help me with this problem.
I created a very simple program for you, that lets you move around a circle using WASD.
I recommend you check out this playlist on youtube. It helped me get started well with SFML, and taught me all the basics -