Tuesday, June 3, 2014

#5 turtle Include kornjaca

#ifndef C_TURTLE_H
#define C_TURTLR_H
#include <graphics.h>
#include "c_shape.h"

class c_turtle:public c_shape{
public:
c_turtle(int _x, int _y, int _r, int _color);
void drawMe(int x, int y);
void eraseMe(int x, int y, int backColor);
};
c_turtle::c_turtle(int _x, int _y, int _r, int _color){

x=_x;
y=_y;
radius=_r;
color=_color;
drawMe(x,y);
}
void c_turtle::drawMe(int x, int y){
setcolor(this->getColor());
     circle(x,y,this->getRadius());  

}
void c_turtle::eraseMe(int x, int y, int backColor){
setcolor(backColor);
    circle(x,y,this->getRadius());
}
#endif

No comments:

Post a Comment