Created
August 7, 2015 00:42
-
-
Save an-OK-squirrel/edee09362d83387d45d9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Not Very Meaningful Statement | |
// also my first P3 program :P | |
// By an-OK-squirrel | |
void setup() { | |
size(500, 500); | |
noStroke(); | |
fill(255, 255, 255, 10); | |
doAThing(); | |
} | |
void drawObj(int x, int y, int r) { | |
boolean isCircle = random(1) > 0.5; | |
for (int i = 0; i < 4; i++) { | |
if (isCircle) { | |
rect(x - r, y - r, r * 2, r * 2 - i); | |
} else { | |
ellipse(x, y, r * 2, r * 2 - i); | |
} | |
} | |
} | |
void doAThing() { | |
background(60, 10, 80); | |
for (int x = 0; x < 10; x++) { | |
for (int y = 0; y < 10; y++) { | |
drawObj(x * 50 + 25, y * 50 + 25, 50); | |
} | |
} | |
} | |
void draw() { | |
// no clue why, but the below function only works with | |
// a draw function | |
// but I don't need one, so I wrote a nice little happy | |
// set of comments | |
} | |
void mouseClicked() { | |
doAThing(); | |
} |
Heh, thanks! it took a while.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Woah, cool!