Solving an exercise in Dan Shiffman "Learning Processing"

Note that there are two things called mousePressed – a function, which is called whenever the mouse is pressed, and a variable, which is true whenever the mouse is pressed.

Use the variable in draw – use the function outside.

1 Like