Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ifndef CIRCLE_H_INCLUDED
- #define CIRCLE_H_INCLUDED
- #include "../Headers/Lib110ct.h"
- class Circle
- {
- protected:
- double mx, my, mdx, mdy, mradius;
- public:
- Circle(){}
- Circle(double x,double y,double dx,double dy,double rad):mx(x),my(y),mdx(dx),mdy(dy),mradius(rad){}
- void setPos(double x, double y){mx=x;my=y;}
- void setDir(double dx, double dy){mdx=dx; mdy=dy;}
- void setRadius(double rad){mradius=rad;}
- double getX(){return mx;}
- double getY(){return my;}
- void draw(Turtle * t);
- void clear(Win110ct& win);
- void move();
- bool collides(Circle & c);
- };
- // derived base
- class Orbiter : public Circle
- {
- Circle * orbits;
- double mangle, angVel, distance;
- public:
- Orbiter():orbits(0),mangle(0),angVel(0),distance(0),Circle(){}
- void setVelocity(double ang){angVel = ang;}
- void setOrbits(Circle * c){orbits = c;}
- void setDistance(double dist){distance = dist;}
- void move();
- };
- class Chaser : public Circle
- {
- Circle * target;
- double mvelocity;
- public:
- Chaser():target(0),mvelocity(0),Circle(){}
- void setVelocity(double velocity){mvelocity=velocity;}
- void setTarget(Circle * tgt){target = tgt;}
- void move();
- };
- #endif // CIRCLE_H_INCLUDED
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement