I'm using the mousePressed functions at various points within my draw loop, but want the code to stop and wait at these points (i.e. not continue with the code if the mouse isn't pressed).
I've written all the rules in the mousePressed function at the beginning (outside my draw loop), but can't work out how to create a listener function that will stop the code until the mouse is pressed while the code is running.
Using JavaScript if that helps, any help with this would be very much appreciated :)