Skip to content

Instantly share code, notes, and snippets.

@wonderburg7
Last active December 16, 2018 20:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wonderburg7/787dc70a4e6e8c870ae8f173791802b2 to your computer and use it in GitHub Desktop.
Save wonderburg7/787dc70a4e6e8c870ae8f173791802b2 to your computer and use it in GitHub Desktop.
int x1 = 0; // always stays the same
int xDistance = 200;
int y1 = 0; //should grow with each addition
int x2 = 0; //shouldn't change either
int y2 = 0;
int lineLength = 0;
int circSize;
int arcWidth, arcHeight, lineLength2;
int quadHeight, quadWidth, qx2, qy2, qx3, qy3, qx4, qy4, coin, coin2, circWidth;
int randTen;
void setup() {
size(4000, 4000);
background(45, 42, 50);
strokeWeight(4);
stroke(238, 239, 168);
// noLoop();
noFill();
ellipseMode(CENTER);
}
void draw() {
// LINE
lineLength = int(random(20, 50));
y2 += lineLength;
line(x1, y1, x2, y2);
y1 = y2;
while (y1 < height) {
coin = int(random(1, 16));
randTen = int(random(10));
if (coin == 1) {
// ELLIPSE
circSize = int(random(50, 70));
line(x1, y1, x1, y1+randTen);
y1 += randTen;
y2 += randTen;
ellipse(x1, y1+(circSize/2), circSize, circSize);
y1 += circSize;
y2 += circSize;
} else if (coin == 2) {
// ARC
int arcWidth = int(random(50, 200));
int arcHeight = int(random(50, 200));
// y1 += (arcHeight/2);
arc(x1, y1-(arcHeight/2), arcWidth, arcHeight, PI, TWO_PI); // make the last two 0, PI for it to fast upwards
line(x1, y1-(arcHeight/2), x1, y2+(arcHeight/2));
y1 += (arcHeight/2);
y2 += (arcHeight/2);
// line(x1, y1, x1, y1);
line(x1, y1, x1, y1+randTen);
y1 += randTen;
y2 += randTen;
} else if (coin == 3) {
// PERPENDICULAR LINE
lineLength = int(random(25, 100));
line(x1-(lineLength/2), y1, x1+(lineLength/2), y1);
} else if (coin == 4) {
// UPWARD TRIANGLE
int triangleHeight = int(random(25, 150));
int triangleWidth = int(random(50, 250));
int tpx2, tpy2, tpx3, tpy3;
line(x1, y1, x1, y1+randTen);
y1 += randTen;
y2 += randTen;
tpx2 = x1+(triangleWidth/2);
tpy2 = y1+triangleHeight;
tpx3 =x1-(triangleWidth/2);
tpy3 = tpy2;
triangle(x1, y1, tpx2, tpy2, tpx3, tpy3);
y1 += triangleHeight;
y2 += triangleHeight;
} else if (coin == 5) {
// QUAD
int quadHeight = int(random(50, 250));
int quadWidth = int(random(50, 250));
int qx2, qy2, qx3, qy3, qx4, qy4;
line(x1, y1, x1, y1+randTen);
y1 += randTen;
y2 += randTen;
qx2 = x1+(quadWidth/2);
qy2 = y1+(quadHeight/2);
qx3 = x1;
qy3 = y1+quadHeight;
qx4 = x1-(quadWidth/2);
qy4 = y1+(quadHeight/2);
quad(x1, y1, qx2, qy2, qx3, qy3, qx4, qy4);
y1 += quadHeight;
y2 += quadHeight;
} else if (coin == 6) {
// ELLIPSE WITH LINE
line(x1, y1, x1, y1+randTen);
y1 += randTen;
y2 += randTen;
circSize = int(random(50, 150));
ellipse(x1, y1+(circSize/2), circSize, circSize);
y1 += circSize;
y2 += circSize;
line(x1, y1-circSize, x2, y2);
} else if (coin == 7) {
// DOUBLE ELLIPSE
line(x1, y1, x1, y1+randTen);
y1 += randTen;
y2 += randTen;
circSize = int(random(50, 150));
ellipse(x1, y1+(circSize/2), circSize, circSize);
ellipse(x1, y1+(circSize/2), circSize/2, circSize/2);
y1 += circSize;
y2 += circSize;
} else if (coin == 8) {
// ELLIPSE ELLIPSE
line(x1, y1, x1, y1+randTen);
y1 += randTen;
y2 += randTen;
circSize = int(random(25, 70));
circWidth = int(random(50, 150));
ellipse(x1, y1+(circSize/2), circWidth, circSize);
y1 += circSize;
y2 += circSize;
} else if (coin == 9) {
// DOUBLE ARC
int arcWidth = int(random(50, 200));
int arcHeight = int(random(50, 200));
// y1 += (arcHeight/2);
line(x1, y1-(arcHeight/2), x1, y2+(arcHeight/2));
arc(x1, y1-(arcHeight/2), arcWidth, arcHeight, PI, TWO_PI); // make the last two 0, PI for it to fast upwards
y1 += arcHeight*.33;
y2 += arcHeight*.33;
arc(x1, y1, arcWidth*.33, arcHeight*.33, PI, TWO_PI);
line(x1, y1-(arcHeight/2), x1, y2+(arcHeight/2));
y1 += (arcHeight/2);
y2 += (arcHeight/2);
// line(x1, y1, x1, y1);
line(x1, y1, x1, y1+randTen);
y1 += randTen;
y2 += randTen;
} else if (coin == 10) {
//FORK LINES
lineLength = int(random(50, 100));
lineLength2 = int(random(0, 50));
line(x1-(lineLength/2), y1, x1+(lineLength/2), y1);
line(x1-(lineLength/2), y1, x1-(lineLength/2), y1+lineLength2);
line(x1+(lineLength/2), y1, x1+(lineLength/2), y1+lineLength2);
line(x1, y1, x1, y1+lineLength);
y1 += lineLength/2;
y2 += lineLength/2;
} else if (coin == 11) {
//DOUBLE PERPENDICULAR LINE
line(x1, y1, x1, y1+randTen);
y1 += randTen;
y2 += randTen;
lineLength = int(random(50, 100));
line(x1-(lineLength/2), y1, x1+(lineLength/2), y1);
y2 += lineLength*.5;
line(x1, y1, x2, y2);
line(x1-((lineLength/2)*.5), y1, x1+((lineLength/2)*.5), y1);
y1 = y2;
} else if (coin == 12) {
//DOUBLE QUAD
quadHeight = int(random(50, 200));
quadWidth = int(random(50, 200));
line(x1, y1, x1, y1+randTen);
y1 += randTen;
y2 += randTen;
qx2 = x1+(quadWidth/2);
qy2 = y1+(quadHeight/2);
qx3 = x1;
qy3 = y1+quadHeight;
qx4 = x1-(quadWidth/2);
qy4 = y1+(quadHeight/2);
quad(x1, y1, qx2, qy2, qx3, qy3, qx4, qy4);
quad(x1, y1, x1+(quadWidth/4), y1+(quadHeight/4), qx3, y1+(quadHeight/2), x1-(quadWidth/4), y1+(quadHeight/4));
y1 += quadHeight;
y2 += quadHeight;
} else if (coin == 13) {
// UPSIDE DOWN ARC
int arcWidth = int(random(50, 200));
int arcHeight = int(random(50, 200));
// y1 += (arcHeight/2);
arc(x1, y1-(arcHeight/2), arcWidth, arcHeight, 0, PI); // make the last two 0, PI for it to fast upwards
line(x1, y1-(arcHeight/2), x1, y2+(arcHeight/2));
y1 += (arcHeight/2);
y2 += (arcHeight/2);
// line(x1, y1, x1, y1);
line(x1, y1, x1, y1+randTen);
y1 += randTen;
y2 += randTen;
} else if (coin == 14) {
// DOWNWARD TRIANGLE
int triangleHeight = int(random(25, 150));
int triangleWidth = int(random(50, 250));
int tpx2, tpy2, tpx3, tpy3;
line(x1, y1, x1, y1+randTen);
y1 += randTen;
y2 += randTen;
tpx2 = x1+(triangleWidth/2);
tpy2 = y1+triangleHeight;
tpx3 = x1-(triangleWidth/2);
tpy3 = tpy2;
triangle(x1-(triangleWidth/2), y1, x1+(triangleWidth/2), y1, x1, y1+triangleHeight);
y1 += triangleHeight;
y2 += triangleHeight;
} else if (coin == 15) {
//UPSIDE DOWN FORK LINES
lineLength = int(random(50, 100));
lineLength2 = int(random(0, 50));
line(x1-(lineLength/2), y1, x1+(lineLength/2), y1);
line(x1-(lineLength/2), y1, x1-(lineLength/2), y1-lineLength2);
line(x1+(lineLength/2), y1, x1+(lineLength/2), y1-lineLength2);
line(x1, y1, x1, y1+lineLength);
y1 += lineLength/2;
y2 += lineLength/2;
} else if (coin == 16) {
// UPSIDE DOWN DOUBLE ARC
int arcWidth = int(random(50, 200));
int arcHeight = int(random(50, 200));
// y1 += (arcHeight/2);
line(x1, y1-(arcHeight/2), x1, y2+(arcHeight/2));
arc(x1, y1-(arcHeight/2), arcWidth, arcHeight, 0, PI); // make the last two 0, PI for it to fast upwards
y1 += arcHeight*.33;
y2 += arcHeight*.33;
arc(x1, y1, arcWidth*.33, arcHeight*.33, 0, PI);
line(x1, y1-(arcHeight/2), x1, y2+(arcHeight/2));
y1 += (arcHeight/2);
y2 += (arcHeight/2);
// line(x1, y1, x1, y1);
line(x1, y1, x1, y1+randTen);
y1 += randTen;
y2 += randTen;
}
coin2 = int(random(1, 4));
if (coin2 >= 3) {
// LINE
lineLength = int(random(50, 100));
y2 += lineLength;
line(x1, y1, x2, y2);
y1 = y2;
}
}
if (y1 > height && x1 < width){
y1 = 0;
y2 = 0;
x1 += xDistance;
x2 += xDistance;
};
save("genlines.png");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment