ICM Class 2 – Variables and Animating

I want to thoroughly understand the code I’m writing, so I made a very simple animation of circles and squares behaving randomly or in response to the cursor. Even with a simple sketch, I still have a lot of questions! I’ve listed them in the code itself, which you can see below. I had fun problem-solving my code when it didn’t run — especially when I was able to fix it.

Originally I wanted to be able to click the mouse four times, and each time a ball would behave differently, whether shy, clingy, bouncy, or frenetic. I’d like to learn how to have “four different clicks” and get further with shyness and bounciness.

Here is my sketch: http://alpha.editor.p5js.org/fergfluff/sketches/HJaD8moqZ

Here is my code: