class Flower { // class name // define variables float x; float y; float c; float h; float speed; // constructor Flower(float Tempx, float Tempy, float Tempc, float Tempspeed){ x = Tempx; y = Tempy; c = Tempc; speed = Tempspeed; } // functionality // draw stem void drawstem(){ // draw curve //y defines tall of the stem, x determine the x position of the stem, c determines the curve noFill(); stroke(0); //200,200 defines the bottom point curve(c,50, x, y, 200, 450, 950, 900); } // move stem void stemmove() { // make curve moves x = x+speed; // contrains the movement of curve and reverse movement if ( x > 250 || x<50) { speed = speed *-1; } } //draw ball void ball(int diameter){ //draw petals fill(255,255,0); // draw ball fill(255); stroke(0); ellipseMode(CENTER); // x and y defines the position of the ball = stem position fill(255); stroke(0); ellipse(x,y,diameter,diameter); //noFill(); } }