Hello. I am a beginner and I would like to know how to encorporate mouse interaction (either repel or attract) to the swirl I have set up. Is is possible to do this? If so how can I? Any advice would be awesome. Also, how can I change the color of the lines? I dont know which piece of code that is.
pushMatrix();
translate(random(-7,5),random(-7,5));
//creates tension of the tunnel moving
//allows it to shake on both x and y axis
for(int i = 2;i<800;i+=4){
//iterated rectangles that form the strokes that appear to be the "tunnel"
stroke(23,23,45,633);
pushMatrix();
translate(width/2,height/2);
rotate(frameCount*(1.0+i/570.0*noise(frameCount/300.0)));
//controls the initial tunnel image to move back and fourth
//framecount counts the number of frames since the sketch started
stroke(255,noise((frameCount-i)/60.0)*250);
rect(0,0,2+i,2+i);
popMatrix();
}
popMatrix();
pushStyle();
//creates rectangles into appeared tunnel (with POP)
strokeWeight(10);
stroke(0);
noFill();
rect(width/2,height/2,width,height);
//rectangles that from iterated lines
popStyle();
}
void mousePressed()
{
value = value + 5;
if (value > 255) {
value = 0;