In the previous chapter, we learned about the p5.js frameCount variable that provides us with a number that represents the number of times the draw function is called. There are a bunch of other highly useful variables that we could be using in p5.js. We will learn a few more in this chapter.
mouseIsPressed
mouseIsPressed is the first p5.js variable that we will see that allows us to add some interactivity to our programs. mouseIsPressed is a p5.js variable that assumes the value true when the mouse is clicked on the canvas area and false for every other time. Let’s alter one of ...