xxxxxxxxxx
16
let img;
function setup() {
createCanvas(400, 400);
img = loadImage("arrow.jpg");
imageMode(CENTER);
}
function draw() {
background(220);
push();
translate(width/2, height/2);
rotate(atan2(-(height/2 - mouseY), -(width/2 - mouseX)));
image(img, 0, 0, 100, 100);
pop();
}