Skip to content

Instantly share code, notes, and snippets.

Created August 30, 2017 01:08
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 anonymous/1595c92ccb146e9b9bffbc6fdbe6c54d to your computer and use it in GitHub Desktop.
Save anonymous/1595c92ccb146e9b9bffbc6fdbe6c54d to your computer and use it in GitHub Desktop.
void setup () {
background (0);
size(800, 800);
noLoop ();
strokeWeight (2);
//slighty thick line for glitch effect
}
void draw(){
//creates loop
for (int i = 0 ; i < 800 ; i = i + 5){
for (int j = 0 ; j < 800 ; j = j + 20){
//copy/paste function numerous times and change the colours
drawGlitch (i,j);
stroke(220,0,220);
drawGlitch (i,j);
stroke(255,0,0);
drawGlitch (i,j);
stroke(0,255,0);
drawGlitch (i,j);
stroke(0,0,255);
drawGlitch (i,j);
stroke(200,0,200);
}
}
}
//create function w parameters
void drawGlitch (int across, int down){
line(across, down, across + 10, down + random(10));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment