void setup() { //set up canvas size size(400, 400); //set up rec and ellipse modes rectMode(CORNERS); ellipseMode(CENTER); //set framerate to provide best movement frameRate(144); } void draw() { background(mouseY/9, mouseY/4, mouseY/1); noStroke(); //sun fill(255, 243, 13); ellipse((190+170*cos(radians(mouseY/1.3))), (200+170*sin(radians(mouseY/1.3))), 80, 80); //moon fill(196, 223, 247); ellipse((190+170*cos(radians(mouseY/1.3)-PI)), (200+170*sin(radians(mouseY/1.3)-PI)), 80, 80); fill(mouseY/9, mouseY/4, mouseY/1); ellipse((205+170*cos(radians(mouseY/1.3)-PI)), (200+170*sin(radians(mouseY/1.3)-PI)), 60, 60); //mountain fill(96, 77, 116); triangle(200, 60, 0, 175, 400, 175); rect(0, 175, 400, 400); fill(81, 66, 98); triangle(130, 200, 10, 400, 70, 400); triangle(250, 120, 390, 400, 450, 400); //mountain top //tree tops fill(47, 128, 99); ellipse(50, 350, 120, 200); ellipse(120, 380, 100, 100); ellipse(350, 350, 120, 200); ellipse(280, 380, 100, 100); //Lleg fill(220, 220, 220); rect(175, 270, 190, 330); //Lfoot fill(0, 0, 0); rect(170, 330, 195, 340); //Rleg fill(220, 220, 220); quad(185, 270,195, 260, 225, 292, 213,300); ellipse(218, 300, 21, 21); rect(200, 295, 215, 310); //Rfoot fill(0, 0, 0); rect(190, 290, 200, 315); //right bicep fill(240, 240, 255); quad(235+(mouseX-210)/22, 205, 210, 170, 210, 195, 223+(mouseX-210)/22, 210); //left bicep quad(145+(mouseX-210)/22, 205, 160+(mouseX-210)/22, 210, 170, 195, 170, 170); //body fill(255, 255, 255); rect(170, 170, 210, 270); //sash fill(0, 0, 0); rect(170, 230, 210, 240); triangle(170, 170, 210, 230, 200, 230); triangle(170, 170, 180, 170, 210, 230); //headband fill(206, 0, 0); rect(160+(mouseX-210)/22, 120, 220+(mouseX-210)/22, 130); ellipse(227+(mouseX-210)/22, 125, 20, 20); triangle(227+(mouseX-210)/22, 125, 245+(mouseX-210)/22, 135, 235+(mouseX-210)/22, 145); triangle(248+(mouseX-210)/22, 156, 245+(mouseX-210)/22, 135, 235+(mouseX-210)/22, 145); triangle(227+(mouseX-210)/22, 125, 215+(mouseX-210)/22, 155, 230+(mouseX-210)/22, 150); triangle(228+(mouseX-210)/22, 166, 215+(mouseX-210)/22, 155, 230+(mouseX-210)/22, 150); //head fill(245, 232, 177); triangle(160+(mouseX-210)/22, 130, 220+(mouseX-210)/22, 130, 190+(mouseX-210)/22, 180); //eyes stroke(0, 0, 0); strokeWeight(3); line(182+(mouseX-210)/30, 140, 173+(mouseX-210)/30, 142); line(198+(mouseX-210)/30, 140, 207+(mouseX-210)/30, 142); //pole strokeWeight(8); line(180, 400, 180, 340); noStroke(); //moustache fill(0, 0, 0); triangle(196+(mouseX-210)/30, 155, 216+(mouseX-210)/30, 175, 211+(mouseX-210)/30, 180); triangle(196+(mouseX-210)/30, 155, 211+(mouseX-210)/30, 180, 191+(mouseX-210)/30, 160); triangle(184+(mouseX-210)/30, 155, 164+(mouseX-210)/30, 175, 169+(mouseX-210)/30, 180); triangle(184+(mouseX-210)/30, 155, 169+(mouseX-210)/30, 180, 189+(mouseX-210)/30, 160); //right forearm fill(240, 240, 255); rect(195+(mouseX-210)/22, 210, 232+(mouseX-210)/22, 220); ellipse(230+(mouseX-210)/22, 212, 17, 17); //left forearm fill(240, 240, 255); rect(148+(mouseX-210)/22, 210, 185+(mouseX-210)/22, 220); ellipse(150+(mouseX-210)/22, 212, 17, 17); //hands fill(245, 232, 177); rect(185+(mouseX-210)/22, 200, 195+(mouseX-210)/22, 220); //eyes stroke(215, 202, 147); strokeWeight(1); line(190+(mouseX-210)/22, 200, 190+(mouseX-210)/22, 220); }