xxxxxxxxxx
28
let x;
let y;
function setup() {
createCanvas(400, 400);
x=width/2;
y= height/2;
}
function draw() {
background(220);
fill("turquoise");
ellipse(x, y, 50, 50);
//calculate horizontal speed
let xSpeed= (mouseX- x)/200
let ySpeed= (mouseY- y)/200
x += xSpeed
y += ySpeed
//carrie helped me with this
}