For this assignment I wanted to test out different shapes and colors while making some transparent and similar to the background. I also used the if mouse pressed code to create the black square to change color as the mouse is pressed, also the stroke weights and background differ more than the actual fill of the shapes. The background is being reset each time the shapes move so there won’t be a path of shapes in the background. The code also has a way to put the path back on for the path to be a way to draw using the square if someone would like to use that. Lastly there is also a variable used in this code that I called “rad” to use instead of numbers.
int rad = 0;
void setup(){
size(600,400);
background(150,200,255);
}
void draw(){
if(mousePressed == true) {
fill(0,100,0,100);
} else {
fill(0);
}
//background(150,200,255);
rect(mouseX,mouseY, 30, 30);
rad = rad + 1;
println (rad);
stroke(200);
strokeWeight(5);
fill(200,0,0,200);
//fills the rectangle
rect(rad,30 ,20,50);
//draws the rectangle
fill(0,50,0,50);
triangle( rad,rad+100,300,rad,360,rad);
fill(0,0,255,120);
arc(rad,rad,200,270, PI, TWO_PI);
}