Project 03 -Dynamic Drawing

sketch

function setup(){
    createCanvas(640,480);
}

function draw(){
    //as mouse moves to right, time in day advances in frame
    if(mouseX<=160){ 
        background(204,255,255); //early morning sky
    }else if(mouseX>160 & mouseX<320){
        background(153,255,255) //midday sky
    }else if(mouseX>320 && mouseX<480){
        background(0,0,153) //evening dusk
    }else if(mouseX>=480){
        background(64,64,64) //nighttime
    }

    noStroke();
    fill(0,153,0);
    rect(0,300,640,200) //grass
    fill(225);
    rect(175,125,300,200) //hunt library base
    fill(205)
    rect(175,125,300,15) //horizontal bars
    rect(175,175,300,15)
    rect(175,225,300,15)
    rect(175,275,300,15)
    

    if (mouseX<=480){
        fill(200)
        rect(175,125,20,200) //vertical bars
        rect(215,125,20,200)
        rect(255,125,20,200)
        rect(295,125,20,200)
        rect(335,125,20,200)
        rect(375,125,20,200)
        rect(415,125,20,200)
        rect(455,125,20,200)
    }else{
        fill(204,0,0) //red
        rect(175,125,20,200)
        fill(255,128,0) //orange
        rect(215,125,20,200)
        fill(255,255,0) //yellow
        rect(255,125,20,200)
        fill(0,255,0) //green
        rect(295,125,20,200)
        fill(0,0,255);
        rect(335,125,20,200)
        fill(0,255,255)//light blue
        rect(375,125,20,200)
        fill(102,0,204) //purple
        rect(415,125,20,200)
        fill(255,0,255) //pink
        rect(455,125,20,200)

    }

    fill(250)
    rect(300,250,50,75) //hunt door
    rect(287.5,250,75,5) //awning
    
    //this is the scottie doggo now

    fill(0)
    rect(341,375,150,55,25,25)//body
    ellipse(362,435,40,20) //left foot
    ellipse(470,435,40,20) //rightfoot
    rect(470,365,15,20,85,0,55,55) //tail
    ellipse(356,360,60,60) //head
    rect(315,365,50,25,5,5) //muzzle
    ellipse(330,365,30,20) //head muzzle connector
    rect(315,385,5,10,25,5,0,5) //beard
    rect(320,385,5,10,25,5,0,5)
    rect(325,385,5,10,25,5,0,5)
    rect(330,385,5,10,25,5,0,5)
    triangle(355,327.5,385,327.5,375,355) //ear
    fill(255)
    ellipse(340,350,10,10) //eye
    fill(0)
    ellipse(337.5,347.5,5,5) //pupil
    fill(215)
    ellipse(317.5,362.5,10,7) //nose

    fill(0,102,204)
    ellipse(200,435,80,25) //food bowl
    rect(160,420,80,20,25,25)


    if(mouseY<300){
        fill(255)
        push()
        rotate(radians(40)) //left bone
        rect(400,200,25,10,10,10,10,10)
        ellipse(400,200,10,10)
        ellipse(400,210,10,10)
        ellipse(425,200,10,10)
        ellipse(425,210,10,10)
        pop()
    }else{
//bone 2
        fill(255)
        push()
        rotate(radians(40)) //left bone
        rect(400,200,25,10,10,10,10,10)
        ellipse(400,200,10,10)
        ellipse(400,210,10,10)
        ellipse(425,200,10,10)
        ellipse(425,210,10,10)
        pop()
        rotate(radians(-30)) //right bone
        rect(-30,470,25,10,10,10,10,10)
        ellipse(-30,470,10,10)
        ellipse(-30,480,10,10)
        ellipse(-5,470,10,10)
        ellipse(-5,480,10,10)
        pop()
    }
}
    

For this project I decided to use let the mouse determine the daylight (as dragged to the right, it becomes night, as shown by the darkness and how Hunt light ups), and as the mouse goes closer to the food bowl, the scottie dog gets more food. My process first started by creating the simple drawing, and then adding if statements to allow the concept of daylight to change as well as the feeding of the dog.

Leave a Reply