Animating Sketch with P5.Js

Castor is ready to play!!

In this sketch, I’ve tried to add some move.

There is, three elements controlled by mouse. One of them is with mouseIsPressed() function, while others are mouseDragged() function. The toy is controlled by mouse and the eyes are following the toy. The cat (Castor) closes his eyes when mouse clicked. While cats paying attention to something, their tail generally stops moving. So I wanted to show that movement by stopping his tail movement when the toy is just in front of him. If you move the toy around him, he gets excited.

When the sketch fist played, the movement if the tail is the element that changes over time, independently of the mouse. The collet of Castor is shining, I tried to show this effect by giving random colors to the element.

You can reach to code from the following link;

https://editor.p5js.org/bestesaylar/sketches/Fw3zPf9R5