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.
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.