So I am very confused on how to make a triangle and a custom shape follow my cursor, with ellipses and rectangles it is very simple because I can just switch the x and y values to mouseX and mouse Y,
but with a triangle I do not want to change anything about the shape I just want it to follow the cursor but I am clueless on how to do that, same thing goes for the custom shape I do not know how to make it follow my cursor.
void setup() {
size(600,600);
}
void draw() {
noStroke();
background(200,230,250);
fill(105,232,37);
rect(mouseX,mouseY,130,20);
//Face
fill(188,96,9);
ellipse(mouseX+65,mouseY-40,100,100);
fill(255);
ellipse(mouseX+40,mouseY-45,15,15);
ellipse(mouseX+85,mouseY-45,15,15);
// I need help here
triangle(280,160,320,160,300,180);
//Hands
fill(189,96,9);
ellipse(mouseX,mouseY+10,30,30);
ellipse(mouseX+120,mouseY+10,30,30);
//TORSO
//I need help here
beginShape();
noStroke();
fill(8,30,255);
vertex(260,205);
vertex(260,350);
vertex(275,350);
vertex(275,260);
vertex(320,260);
vertex(320,350);
vertex(335,350);
vertex(335,205);
endShape();
}