class segment { legs leg; float x; //x position float y; //y postion float d; //diameter of segment float period; //period of the legs color c; //color of the segment segment(float x_, float y_, float d_, float period_, color c_) { x=x_; y=y_; d=d_; period=period_; c=c_; leg= new legs(x,y, d, 15, 65); } float getX() {return x;} void setX(float x_) {x = x_;} float getY() {return y;} void setY(float y_) {y = y_;} float getD() {return d;} void setD(float d_) {d=d_;} float getP() {return period;} void setP(float period_) {period=period_;} color getC() {return c;} void setC(color c_) {c=color(red(c_),blue(c_),green(c_),alpha(c_));} void render(float ticker) { noStroke(); fill(c); //draw main body ellipse(x,y,d,d); //draw legs resetleg(); leg.render(ticker); } void resetleg() { leg.setCX(x); leg.setCY(y); } void setheading(float a) { leg.setTILT(a); } }//End of segment class