// Function for drawing an animated wirefunctiondrawAnimatedWire(x1,y1,x2,y2,speed1,state){if(state){letdistance=dist(x1,y1,x2,y2);letcirclePos=map((millis()*speed1)%distance,0,distance,0,1);letx=lerp(x1,x2,circlePos);lety=lerp(y1,y2,circlePos);stroke(0);strokeWeight(lineWidth)line(x1,y1,x2,y2);fill(255,0,0);noStroke();circle(x,y,10);}else{stroke(0);strokeWeight(lineWidth)line(x1,y1,x2,y2);}}