Watch. first, it will do this drawing, and then it will follow your mouse.
I used a code from a book, so thank you Everything You Need To Ace Computer Science and Coding!