Hi! I am currently playing around with coding the ability to draw in p5.js, and so far it’s turning out okay, but I have a question about using the mouse as a brush. Ideally, I would like to have it where whenever the user clicks the mouse (mousePressed), the brush will stop making lines, and then continue making lines when it is pressed again. I currently also have it set to whenever the mouse is pressed, the background is cleared and recreated. When I tried typing in the code to have both the background reset and the brush stop/start, the brush stopped appearing.
Am I missing a step to add the ability to control when the brush is and isn’t being used, or am I ordering the information incorrectly? I have attached a link to my sketches; you can view the project that is named “Sketchy Sketch.” Thanks in advance!!