xxxxxxxxxx
/*-----------------------------
Button Rave
Click on the button
Created 2-5-17
Renee Cheng
cheng.835
https://www.openprocessing.org/sketch/404550
-----------------------------*/
void setup()
{
background(125);
size(500,500);
}
void draw()
{
int center = 250;
rectMode(CENTER);
fill(0, 120, 75);
rect(center,center,50,50);
if (mousePressed)
{
if((mouseX >center - 25) && (mouseX <center + 25 ))
{
if((mouseY>center - 25) && (mouseY <center + 25))
{
buttonRave();
}
}
}
}
void buttonRave()
{
int x;
int y = 10;
for(y=10; y<490; y=y+10)
{
for(x=10; x<490; x=x+10)
{
fill((random(255)),(random(255)),(random(255)));
ellipse(x,y,10,10);
}
}
}