function setup() {
createCanvas(400, 400);
}
function draw() {
var x=200
var y=200
fill(0,255,0)
background(220);
if(mouseX>150){
x=230
}
if(mouseX<75){
x=170
}
if(mouseY>200){
y=230}
if(mouseY<100){
y=170
}
ellipse(x,y,30,30)
}
https://preview.p5js.org/nicepelican061/present/KcCJc17c7
function setup() {
createCanvas(400, 400);
}
function draw() {
var x=60
fill(0,255,0)
background(220);
if(mouseX>200){
x=30
}
if(mouseY<200){
fill(255,0,0)
}
ellipse(200,200,x,x)
}