so I am trying to make a hot and cold game and i have a randomly generated ellipse and i was wondering how to find the location of the ellipse in relation to my mouse so whenever i click it shows me how far away i am from the randomly generated invisible ellipse. here is the code i have now, any help would be much appreciated as i am very new to processing.
final int ballDiam = 30;
float posX;
float posY;
final int coldDetector = 400;
final int warmDetector = 250;
final int hotDetector = 100;
final int hotColor = color(255,0,0);
final int warmColor = color(255,100,0);
final int coldColor = color(0,0,255);
void setup()
{
size(500,500);
posX = random(width);
posY = random(height);
}
void draw()
{
background(200);
//add stroke (stroke(200); when progrm is finished
fill(200);
ellipse(posX,posY,ballDiam,ballDiam);
noFill();
ellipse(mouseX,mouseY,50,50);
}