Hello, I am terribly confused on how to start my most recent programming assignment. I am to use an abstract class (shapeO) to create a child class (animShapeO). The program is supposed to create rectangles and moving them (hypothetically as there are no graphics involved) across the screen and when they overlap with each other both disappear.
The shapeO class is defined for me.
#ifndef SHAPEO_H
#define SHAPEO_H
class shapeO {
public:
shapeO() {};
virtual ~shapeO() {};
virtual bool collidesWith( shapeO *) = 0 ;
void getRect(double & X, double & Y, double & W, double & H)
{ X = x; Y = y; W = width; H = height; }
void setRect(double X , double Y, double W, double H)
{ x = X; y = Y; width=W; height=H;}
protected:
double x,y, height, width;
};
#endif
and from this I am supposed create the child class animShapeO that has the member data
DIRECTIONVECTOR- which indicates the direction of the rectangle, two doubles x and y
If anyone could give me some insight on how to approach and structure this program it would help me out a lot as it has been a long time since i've worked with derived classes
thank you