PImage leafImage; //define an image object PImage myBackImage; //define an image object void setup(){ leafImage = loadImage("maple_leaf.gif"); //load it myBackImage = loadImage("ground.jpg"); //load it size(myBackImage.width,myBackImage.height); } int x, y; //the location of the cursor void draw(){ image(myBackImage,0,0); //draw the ground image(leafImage,x,y); //then the leaf x += int(random(-5,5)); //random tremblings y += int(random(-5,5)); } void mouseDragged(){ x = mouseX-(leafImage.width/2); //move the cursor y = mouseY-(leafImage.height/2); }