class Leaf { int x, y; //the leaf's position PImage picture; //an image object int rate; //rate of waiting to be redrawn Leaf(){ //constructor x = int(random(width)); //get an initial location y = int(random(height)); picture = loadImage("maple_leaf.gif"); //get the image } int k=0; //a counter void draw() { if(k==rate){ //if the counter is as the rate then draw x += int(random(-5,5)); //random tremblings y += int(random(-5,5)); k=0; //reset the counter } k++; //increate the counter; during every increment there is no draw image(picture,x,y); //now draw the image } }