Project 3: Dynamic Drawing

luca p3

var bs = 50//boxsize
var bv = 5//boxspeed
var bx = 300//box x position
var by = 200//box y position
var an = 180//box angle

function setup() {
    createCanvas(600, 450);
    background(254, 250, 224);
    rectMode(CENTER)
    frameRate(100)
    noStroke();
}

//background
function draw(){

    rotate(radians(an));
    an=an+50;

    function mousePressed(){
        an=an-50
    }

    //colorchange
    if(mouseX<width/2 & mouseYheight/2)
        fill(220, 47, 2);
    if(mouseX<width/2 & mouseY>height/2)
        fill(250, 163, 7);

    rect(bx,by,bs,bs);

    if(mouseX & mouseY >= 600 || mouseY && mouseX >= 450)
        bs=bs+0.1;


}






I find this project quite challenging because we have a lot more variables to consider. I think it was easy to create an interaction that is totally random but it was difficult to create an interaction that was consistent every time. Through this project, I learned more about coding with multiple variables.

Leave a Reply