Project 1: My Self Portrait

sketch
//Siyun Wang, Section C
function setup() {
    createCanvas(400,600);
    strokeWeight(10);
}

function draw() {
    if(mouseX < (width/3)){
        background(160,160,160);
        
    } else if(mouseX > (width*2/3)){
        background(255,153,153);
        
    } else {
        background(204,229,255);
    }

    fill(71,51,24);
    circle((width/2),(height/2),350);
    rect((width-350)/2,(height/2),350,200);

    fill(255,204,153);
    rect(100,425,200,125);

    fill(255,204,153);
    circle(97,300,50);  
    circle(335,300,50);  

    stroke(255,102,178);
    line(350,310,350,345);
    line(85,310,85,345);
    noStroke(); 

    fill(255,153,51);
    square(100,200,225);

    fill(255,153,51);
    arc(212,425,224,125,0,PI);

    fill(88,62,28);
    arc(212,270,260,280,PI,0);

    fill(51,51,255);
    rect(100,550,200,50);

    fill(102,102,255);
    triangle(100,550,100,600,30,600);
    triangle(300,550,300,600,370,600);

    fill(0);
    ellipse(162.5,300,15,30);
    ellipse(287.5,300,13,27);

    fill(102,0,51);
    triangle(225,300,210,370,240,367);

    if(mouseX < (width/3)){
        stroke(0);
        arc(225,450,125,100,PI,0);
        noStroke();
        
    } else if(mouseX > (width*2/3)){
        stroke(0);
        arc(225,400,125,100,0,PI);
        noStroke();
    } else {
        stroke(0);
        line(162.5,425,287.5,425);
        noStroke();
    }
}

Leave a Reply