function setup(){
createCanvas(800,600);
strokeWeight(5); //white lines and stroke around shapes
}
function draw(){
background(0,165,10,1); //green background
stroke(1);
line(100,600,100,50); //black vertical line
if(mouseIsPressed){
stroke(0);
}else{
stroke(255,255,255); // color white in upper horizontal and diagonal lines
}
fill(255,0,0); // color red of the shapes: round, rectangular
line(800,50,50,50);
line(1200,800,50,50);
rect(300,200,160,85);
rect(400,250,160,85);
rect(550,5,160,85);
rect(300,5,160,85)
rect(50,10,160,85);
rect(600,390,100,100);
stroke(1); // black lines diagonal described below
line(1,100,100,100); //black short horizontal line
line(100,100,1400,880); //black diagonal line
stroke(255); // color of stroke around moving shapes are the same as the static ones
ellipse(mouseX, mouseY,50,50);
ellipse(100,400,50,50);
ellipse(100,300,50,50);
ellipse(100,200,50,50);
ellipse(100,500,50,50);
}
Comments
Post a Comment