Draw without clearing background + if/else statements
float x1,y1,x2,y2,x3,y3,x4,y4;
void draw() {
//background(200);
framerate(10);
smooth();
noStroke();
// tegn med hvit, sort om du trykker
if(mousePressed) { fill(0,50); }
else { fill(255,50); }
x1 = random(width);
y1 = random(height);
x2 = random(width);
y2 = random(height);
x3 = mouseX;
y3 = mouseY;
x4 = 10;
y4 = 90;
quad(x1,y1,x2,y2,x3,y3,x4,y4);
}

0 Comments:
Post a Comment
<< Home