ArrayList FillHistory = new ArrayList();
ArrayList TopHistory = new ArrayList();
ArrayList HighlightHistory = new ArrayList();
int designatorNumber = 100;
float distanceThreshhold = 180;
float GODverticalRand = 50;
float secondControl = 1300;
float downControl, specdownControl, mouseControlX, mouseControlY, travelDown;
colorMode(HSB, 360, 100, 100, 100);
web = createGraphics(1280, 720);
guide = createGraphics(1280, 720);
float mouseCommandX = map(constrain(mouseControlX, -100, 100), -50, 50, -0.0004, 0.0004);
float mouseCommandY = map(constrain(mouseControlY, -100, 100), -50, 50, -0.45, 0.45);
downControl = ((pow(map(frameCounter, -140, 1300, -1, 1), 6) * 300));
specdownControl = ((pow(map(frameCounter, primeControl, secondControl, -1, 1), 4) * 300));
GOD = GOD + mouseCommandX;
GODvertical = GODvertical + mouseCommandY;
GODverticalRand = GODverticalRand + mouseCommandY;
PVector exterior = new PVector(frameCounter + random(map(sin(radians(frameCounter)), -1, 1, -50, 50)) - 20, ((random(sin(radians(frameCounter * GOD) - 150) * GODvertical)) + 250 + random(map(sin(radians(frameCounter)), -1, 1, -50, 50)) + downControl), 0);
PVector filler = new PVector(frameCounter + random(-50, 50) - 20, random((random(sin(radians(frameCounter * GOD) - 150) * GODvertical)) + 250 + random(map(sin(radians(frameCounter)), -1, 1, -50, 50)), 720) + downControl, 0);
PVector highlighter = new PVector(frameCounter + random(map(sin(radians(frameCounter)), -1, 1, -50, 50)) - 20, ((random(sin(radians((frameCounter) * GOD) - 150)) * GODvertical) + 250 + random(map(sin(radians(frameCounter)), -1, 1, -50, 50)) + specdownControl), 0);
TopHistory.add(0, exterior);
FillHistory.add(0, filler);
HighlightHistory.add(0, highlighter);
web.colorMode(HSB, 360, 100, 100, 100);
web.stroke(0, 0, 100, 17);
for (int p=0; p<TopHistory.size(); p++) {
PVector v = (PVector) TopHistory.get(p);
float connectChance = p/TopHistory.size() + exterior.dist(v)/distanceThreshhold;
if (connectChance < random(0.3)) web.line(exterior.x, exterior.y, v.x, v.y);
for (int p=0; p<FillHistory.size(); p++) {
PVector l = (PVector) FillHistory.get(p);
float connectChance2 = p/FillHistory.size() + filler.dist(l)/distanceThreshhold;
if (connectChance2 < random(0.4)) web.line(filler.x, filler.y, l.x, l.y);
for (int p=0; p<HighlightHistory.size(); p++) {
PVector v = (PVector) HighlightHistory.get(p);
float connectChance = p/HighlightHistory.size() + highlighter.dist(v)/distanceThreshhold;
if (connectChance < random(0.3)) web.line(highlighter.x, highlighter.y, v.x, v.y);
guide.colorMode(HSB, 360, 100, 100, 100);
guide.stroke(200, 100, 100, 7.5);
dsg = new Designator[designatorNumber];
for (int i = 0; i<dsg.length; ++i) {
float downControl2 = ((pow(map(flowpoint, -140, 1300, -1, 1), 6) * 300));
dsg[i] = new Designator((flowpoint), ((sin(radians(flowpoint * GOD) - 150) * GODvertical) + 250 + map(sin(radians(flowpoint)), -1, 1, -50, 50) )+ downControl2);
flowpoint = flowpoint + (width + 120)/designatorNumber;
for (int l = 1; l<dsg.length; ++l) {
guide.line(dsg[l-1].xpos, dsg[l-1].ypos, dsg[l].xpos, dsg[l].ypos);
if (mousePressed == false) {
guide.fill(0, 0, 0, blur);
guide.rect(0, 0, width, height);
if (frameCount < 150 || mousePressed == true ) {
guide.stroke(200, 100, 100, 12);
guide.line(dsg[o-3].xpos, dsg[o-3].ypos, dsg[o-2].xpos, dsg[o-2].ypos);
guide.line(dsg[o-2].xpos, dsg[o-2].ypos, dsg[o-1].xpos, dsg[o-1].ypos);
guide.line(dsg[o-1].xpos, dsg[o-1].ypos, dsg[o].xpos, dsg[o].ypos);
guide.line(dsg[o].xpos, dsg[o].ypos, dsg[o+1].xpos, dsg[o+1].ypos);
guide.line(dsg[o+1].xpos, dsg[o+1].ypos, dsg[o+2].xpos, dsg[o+2].ypos);
guide.line(dsg[o+2].xpos, dsg[o+2].ypos, dsg[o+3].xpos, dsg[o+3].ypos);
if (o >= (designatorNumber - 4)) {
frameCounter = frameCounter + 2;
frameDeleter = frameDeleter + 2;
if (frameCounter > 1380) {
HighlightHistory.clear();
frameCounter = frameCounter - frameDeleter;
if (primeControl <= 450) {
primeControl = primeControl + 150;
else if (primeControl > 450) {
if (secondControl >= 750) {
secondControl = secondControl - 150;
else if (secondControl < 750) {
if (keyPressed && key == ' ') saveFrame("Connective Terrain #####.png");
if (mouseX > 12 && mouseX < 270 && mouseY > 14 && mouseY < 41) {
if (mouseX > 12 && mouseX < 168 && mouseY > 54 && mouseY < 81) {
text("Clear & Maintain Current Curve", 20, 18);
text("Clear All & Restart", 20, 58);
text("Press Space To Save Creation", width-20, 18);
rect(width-12, 14, width-258, 41);
} else if (pmouseX > mouseX) {
} else if (pmouseY > mouseY) {
if (mouseX > 12 && mouseX < 270 && mouseY > 14 && mouseY < 41) {
HighlightHistory.clear();
web.background(0, 0, 0, 0);
if (mouseX > 12 && mouseX < 168 && mouseY > 54 && mouseY < 81) {
HighlightHistory.clear();
web.background(0, 0, 0, 0);
text("Clear & Maintain Current Curve", 20, 18);
text("Clear All & Restart", 20, 58);
text("Press Space To Save Creation", width-20, 18);
rect(width-12, 14, width-258, 41);
Designator(float xp, float yp) {