Tuesday, April 03, 2012

Drawtest_beta

int c = random(0,50);
int b = random(0,50);
int i = 0; //declaring variable and initialising
void setup () {
  size(500,500);
    background (random(0,250),random(0,250),random(0,250));
}
void draw() {if(i == 1){
rect(mouseX,mouseY,b,c);}
            }
void mousePressed() {
  if(i == 1) {i = 0;}else{i = 1;}
}
void keyPressed() {background(random(0,255),random(0,255),random(0,255));
 c = random(0,75);
b = random(0,75);
 fill(random(0,250),random(0,250),random(0,250));
 stroke(random(0,250),random(0,250),random(0,250));
}

info info

submitted by: Lukasrygh
views: 27
You can press the mouse to start or stop placing squares, key press to wipe the screen and randomise colours. code borrowed from Drawtest_alpha

treeThis sketch has a parent
Tags:

comments comment

loading loading...

 

Add a comment: