I have this code that implements a bubble cursor:
// Global variables
let objects = [];
let cursorX, cursorY;
let selectedObject = -1;
// Set up the environment
function setup() {
 createCanvas(windowWidth, windowHeight);
 // Create objects and their positions
 objects.push(new p5.Vector(width / 3, height / 3));
 objects.push(new p5.Vector((width \* 2) / 3, height / 3));
 objects.push(new p5.Vector(width / 2, (height \* 2) / 3));
 cursorX = mouseX;
 cursorY = mouseY;
} // Main draw function
function draw() {
 background(255); // Update cursor position
 cursorX = mouseX;
 cursorY = mouseY; // Draw objects
 for (let i = 0; i < objects.length; i++) {
 let obj = objects[i];
 if (i === selectedObject) {
 fill(0, 0, 255);
 } else {
 fill(0, 150, 0);
 }
 ellipse(obj.x, obj.y, 30);
 }
 let curBubbleSize = getBubbleSize(cursorX, cursorY);
 // Draw bubble cursor
 fill(255, 0, 0, 80);
 ellipse(cursorX, cursorY, curBubbleSize);
}

// Find shortest distance
function getBubbleSize(x, y) {
 let shortestDist = Infinity;
 
 for (let obj of objects) {
 let distCurr = dist(x, y, obj.x, obj.y);
 if (distCurr < shortestDist) {
 shortestDist = distCurr;
 }
 }
 return (2 \* shortestDist)+30;
}

// Mouse clicked event
function mouseClicked() {
 selectedObject = getClosestObject(cursorX, cursorY);
}
// Find the index of the closest object to the cursor
function getClosestObject(x, y) {
 let closestObjectIndex = -1;
 let shortestDist = Infinity;
 for (let i = 0; i < objects.length; i++) {
 let obj = objects[i];
 let distCurr = dist(x, y, obj.x, obj.y);
 if (distCurr < shortestDist) {
 shortestDist = distCurr;
 closestObjectIndex = i;
 }
 }
 return closestObjectIndex;
}

---------
rewrite it, making the cursor look more like an actual bubble is surrounding the target when it goes near the target. I have this code that implements a bubble cursor:
// Global variables
let objects = [];
let cursorX, cursorY;
let selectedObject = -1;
// Set up the environment
function setup() {
 createCanvas(windowWidth, windowHeight);
 // Create objects and their positions
 objects.push(new p5.Vector(width / 3, height / 3));
 objects.push(new p5.Vector((width \* 2) / 3, height / 3));
 objects.push(new p5.Vector(width / 2, (height \* 2) / 3));
 cursorX = mouseX;
 cursorY = mouseY;
} // Main draw function
function draw() {
 background(255); // Update cursor position
 cursorX = mouseX;
 cursorY = mouseY; // Draw objects
 for (let i = 0; i < objects.length; i++) {
 let obj = objects[i];
 if (i === selectedObject) {
 fill(0, 0, 255);
 } else {
 fill(0, 150, 0);
 }
 ellipse(obj.x, obj.y, 30);
 }
 let curBubbleSize = getBubbleSize(cursorX, cursorY);
 // Draw bubble cursor
 fill(255, 0, 0, 80);
 ellipse(cursorX, cursorY, curBubbleSize);
}

// Find shortest distance
function getBubbleSize(x, y) {
 let shortestDist = Infinity;
 
 for (let obj of objects) {
 let distCurr = dist(x, y, obj.x, obj.y);
 if (distCurr < shortestDist) {
 shortestDist = distCurr;
 }
 }
 return (2 \* shortestDist)+30;
}

// Mouse clicked event
function mouseClicked() {
 selectedObject = getClosestObject(cursorX, cursorY);
}
// Find the index of the closest object to the cursor
function getClosestObject(x, y) {
 let closestObjectIndex = -1;
 let shortestDist = Infinity;
 for (let i = 0; i < objects.length; i++) {
 let obj = objects[i];
 let distCurr = dist(x, y, obj.x, obj.y);
 if (distCurr < shortestDist) {
 shortestDist = distCurr;
 closestObjectIndex = i;
 }
 }
 return closestObjectIndex;
}

---------
rewrite it, making the cursor look more like an actual bubble is surrounding the target when it goes near the target. I want the circle that represents the bubble cursor to become a little deformed on the zone near the target and when it surrounds it, more like an actual bubble that deforms if in touch with an object.
에는 버블 커서를 구현하는 다음 코드가 있습니다:// 전역 변수let objects = [];let cursorX, cursorY;let selectedObject = -1;// 환경 설정함수 setup() { createCanvas(windowWidth, windowHeight); // 객체와 그 위치 생성 objects.push(new p5.Vector(width/3, height/3)); objects.push(new p5.Vector((너비 \* 2) / 3, 높이 / 3)); objects.push(new p5.Vector(width / 2, (height \* 2) / 3)); cursorX = mouseX; cursorY = mouseY;} // 메인 그리기 함수function draw() { background(255); // 커서 위치 업데이트 cursorX = mouseX; cursorY = mouseY; // 객체 그리기 for (let i = 0; i < objects.length; i++) { let obj = objects[i]; if (i === selectedObject) { fill(0, 0, 255); } else { fill(0, 150, 0); } 타원(obj.x, obj.y, 30); } let curBubbleSize = getBubbleSize(cursorX, cursorY); // 버블 커서 그리기 fill(255, 0, 0, 80); 타원(cursorX, cursorY, curBubbleSize);}// 최단 거리 찾기함수 getBubbleSize(x, y) { let shortestDist = Infinity;  for (let 객체 오브젝트) { let distCurr = dist(x, y, obj.x, obj.y); if (distCurr < shortestDist) { shortestDist = distCurr; } } return (2 \* shortestDist)+30;}// 마우스 클릭 이벤트function mouseClicked() { selectedObject = getClosestObject(cursorX, cursorY);}// 커서에서 가장 가까운 객체의 인덱스 찾기function getClosestObject(x, y) { let closestObjectIndex = -1; let shortestDist = 무한대; for (let i = 0; i < objects.length; i++) { let obj = objects[i]; let distCurr = dist(x, y, obj.x, obj.y); if (distCurr < shortestDist) { shortestDist = distCurr; closestObjectIndex = i; } } return closestObjectIndex;}---------다시 작성하여 커서가 대상에 가까워지면 실제 버블이 대상을 둘러싸고 있는 것처럼 보이도록 합니다. 버블 커서를 구현하는 코드는 다음과 같습니다:// 전역 변수let objects = [];let cursorX, cursorY;let selectedObject = -1;// 환경 설정함수 setup() { createCanvas(windowWidth, windowHeight); // 객체와 그 위치 생성 objects.push(new p5.Vector(width/3, height/3)); objects.push(new p5.Vector((너비 \* 2) / 3, 높이 / 3)); objects.push(new p5.Vector(width / 2, (height \* 2) / 3)); cursorX = mouseX; cursorY = mouseY;} // 메인 그리기 함수function draw() { background(255); // 커서 위치 업데이트 cursorX = mouseX; cursorY = mouseY; // 객체 그리기 for (let i = 0; i < objects.length; i++) { let obj = objects[i]; if (i === selectedObject) { fill(0, 0, 255); } else { fill(0, 150, 0); } 타원(obj.x, obj.y, 30); } let curBubbleSize = getBubbleSize(cursorX, cursorY); // 버블 커서 그리기 fill(255, 0, 0, 80); 타원(cursorX, cursorY, curBubbleSize);}// 최단 거리 찾기함수 getBubbleSize(x, y) { let shortestDist = Infinity;  for (let 객체 오브젝트) { let distCurr = dist(x, y, obj.x, obj.y); if (distCurr < shortestDist) { shortestDist = distCurr; } } return (2 \* shortestDist)+30;}// 마우스 클릭 이벤트function mouseClicked() { selectedObject = getClosestObject(cursorX, cursorY);}// 커서에서 가장 가까운 객체의 인덱스 찾기function getClosestObject(x, y) { let closestObjectIndex = -1; let shortestDist = 무한대; for (let i = 0; i < objects.length; i++) { let obj = objects[i]; let distCurr = dist(x, y, obj.x, obj.y); if (distCurr < shortestDist) { shortestDist = distCurr; closestObjectIndex = i; } } return closestObjectIndex;}---------다시 작성하여 커서가 대상에 가까워지면 실제 버블이 대상을 둘러싸고 있는 것처럼 보이도록 합니다. 버블 커서를 나타내는 원이 대상 근처에서 커서를 둘러싸고 있을 때 약간 변형되어 물체에 닿으면 변형되는 실제 버블처럼 보이기를 원합니다.