xxxxxxxxxx
41
let trianglePosX = 100;
let trianglePosY = 200;
function setup() {
createCanvas(600, 400);
}
function draw() {
background(120);
noStroke();
fill(0, 255, 0);
rect(200, 200, 150, 150);
stroke(255, 120, 0);
fill(255, 120, 0, 200);
ellipse(width / 2, height / 2, width / 4, height / 4);
fill(255, 0, 0, 100);
circle(width / 2, height / 2, height / 2);
stroke(255, 120, 0);
line(0, height / 2, width, height / 2);
noStroke();
fill(255);
trianglePosX = mouseX;
trianglePosY = mouseY;
triangle(
trianglePosX,
trianglePosY,
trianglePosX,
trianglePosY + 100,
trianglePosX + 100,
trianglePosY + 100
);
}
//ctrl shift f to organize all the lines of the code
// ctrl // to comment several lines at the same time