Your browser does not support the canvas tag.

previous        Show / Hide Source        Download        next
void setup() {
  size (400,400);
  smooth();
  frameRate(30);
}

void draw(){
background(50,mouseX,255);//makes the background blue

ellipseMode(CENTER);
rectMode(CORNER);

stroke(0);
fill(80,255,0); //drawing the hill in the background
ellipse(200,480,700,500);

//drawing the tree
stroke(0);
fill(139,69,19);
quad(150,280,230,280,mouseX+80,130,mouseX,130);

/*
fill(139,69,19);
line(160,280,mouseX,100);
line(240,280,mouseX+80,100);
line(160,280,240,280);
line(mouseX,100,mouseX+80,100);
*/

stroke(0); //drawing the leaves
fill(0,170,0); 
ellipse(mouseX+40,60,100,100);
stroke(0);
fill(0,170,0); 
ellipse(mouseX-30,100,100,100);
stroke(0);
fill(0,170,0); 
ellipse(mouseX+110,100,100,100);
stroke(0);
fill(0,170,0); 
ellipse(mouseX+40,100,100,100);

//drawing apples
stroke(0);
fill(255,0,0);
ellipse(mouseX-30,100,20,20);
ellipse(mouseX+50,80,20,20);
ellipse(mouseX+130,110,20,20);
ellipse(mouseX+20,40,20,20);

mousePressed();{
  println("Let's dance!");
}
}