float xflower, yflower; void setup(){ size(600,400); // try changing the window size background(50,150,50); frameRate(60); } void draw(){ xflower = random(0,width); yflower = random(0,height); drawflower(xflower,yflower); // calls the drawflower() function, giving it the location where the flower should be drawn } // This is a function definition. It defines a block of code that is run // whenever its name (in this case drawflower()) is called. // The flower is draw at the location "passed" to the function. void drawflower(float xf, float yf){ float size; size = (4 + yf) * 0.03; fill(255,0,0); ellipse(xf,yf,size,size); // draws the center of the flower fill(255,200,200); // try changing the color, or adding a random component to the color stroke(200,100,100); for(float a = 0; a < 2*PI; a = a + 0.4){ // for loop ellipse(xf+size*sin(a) ,yf + size*cos(a),size,size); } }