Skip to content

Instantly share code, notes, and snippets.

@aaronparsekian
Created September 29, 2015 05:13
Show Gist options
  • Save aaronparsekian/b2c00f9263e125517911 to your computer and use it in GitHub Desktop.
Save aaronparsekian/b2c00f9263e125517911 to your computer and use it in GitHub Desktop.
function setup() {
createCanvas(800, 800);
background(0);
frameRate(2400);
}
var m = false;
function draw() {
buttons(0, 103, 154, 255, 0, 0);
buttons(1, 94, 192, 232, 50, 0);
buttons(2, 116, 255, 242, 100, 0);
buttons(3, 94, 232, 163, 150, 0);
buttons(4, 91, 255, 106, 200, 0);
buttons(5, 25, 182, 204, 250, 0);
buttons(6, 95, 146, 153, 300, 0);
buttons(7, 57, 255, 169, 350, 0);
buttons(8, 255, 146, 147, 400, 0);
buttons(9, 204, 25, 115, 450, 0);
ellipses();
}
function ellipses(x, a, z, o, b, s) {
z, q = -200;
o = 10;
b = 20;
translate(width / 2, height / 2);
rotate(s);
s = s + PI / random(10);
line(x = randomGaussian(-200, 200), -sqrt(-pow(x, 2) + 40000), a = randomGaussian(200, 200), sqrt(-pow(a, 2) + 40000));
line(x = randomGaussian(-200, 200), -sqrt(-pow(x, 2) + 40000), a = randomGaussian(200, 200), -sqrt(-pow(a, 2) + 40000));
line(x = randomGaussian(-200, 200), -sqrt(-pow(x, 2) + 40000), a = randomGaussian(200, 200), sqrt(-pow(a, 2) + 40000));
line(x = randomGaussian(-200, 200), -sqrt(-pow(x, 2) + 40000), a = randomGaussian(200, 200), -sqrt(-pow(a, 2) + 40000));
fill(255, 40);
ellipse(x, -sqrt(-pow(x, 2) + 40000), 4, 4);
ellipse(x, -sqrt(-pow(x, 2) + 40000), 2, 2);
x = x + 10;
}
function buttons(bt, r, g, b, x, y, s) {
s = 50;
fill(r, g, b);
rect(x, y, s, s);
if (m == bt) {
stroke(r, g, b, 40);
strokeWeight(2);
}
}
function mousePressed() {
for (i = 0; i < 10; i++) {
if (mouseX > i * 50 && mouseX < (i * 50) + 50 && mouseY < 50) {
m = i;
} else if (mouseY > 50) {
background(0);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment