First, I gave the eyeball its default location values, and then I followed up with the step(smoothness?) of the mouse.

Under function draw(), I added the constraint for the eyeball so it will only follow the mouse in a specific area.


Then, I calculate the difference between x and y to make the eyeball follow the mouse.
Based On the Workflow of (https://editor.p5js.org/jht9629-nyu/sketches/qmtBJEwMe)

p5.js Web Editor _ Wk02_Assignment_Tim - Google Chrome 2024-09-17 13-51-34.mp4
What caused the “stretching effect” when the eyeball reached the constrain line? I can tell it is caused by the value from ballSteps(the larger the value is, the faster the eyeball follows the mouse), but why is it stretching?
I am thinking of doing a mouth that moves up and down through the code itself.