int leftBounds = 20; int topBounds = 20; float x = leftBounds; float y = topBounds; int rightBounds = 380; int bottomBounds = 380; int baseMax = 20; int randomMax = 10; int maxLines = 1000; int counter = 0; //int alpha = 0; Line[] Lines; //Ellipse[] Ellipses; void setup(){ size(400, 400); frameRate(10); colorMode(HSB, 360, 100, 100); background(0, 0, 100); Lines = new Line[maxLines]; // Ellipses = new Ellipse[maxLines]; strokeWeight(1); smooth(); } void draw(){ background(0,0,100); if(counter < maxLines){ float maxDistance = baseMax * random(0, 1) * randomMax; float minDistance = 2; int direction = random(0, 1) < 0.5 ? -1 : 1; float xEnd = x + (direction * (minDistance + ( random(0, 1) * maxDistance)) ); direction = random(0, 1) < 0.5 ? -1 : 1; float yEnd = y + (direction * (minDistance + ( random(0, 1) * maxDistance)) ); if(xEnd < leftBounds) xEnd = leftBounds; if(xEnd > rightBounds) xEnd = rightBounds; if(yEnd < topBounds) yEnd = topBounds; if(yEnd > bottomBounds) yEnd = bottomBounds; Lines[counter] = new Line(x, y, xEnd, yEnd); // Lines[counter].setAlpha(alpha); // Ellipses[counter] = new Ellipse(x, y, maxDistance * .2, maxDistance * .2); x = xEnd; y = yEnd; } counter++; // alpha++; // if(alpha > 255) alpha = 0; // if(counter >= 10 && counter maxLines && counter < maxLines+10) { // Lines[counter-10].disappear(); // } // else if(counter > maxLines+10) noLoop(); if(counter < maxLines){ for(int i=0; i