Your first interactive drawing sketch allowed you to create art using lines. This drawing tool will let you create fields of grass. While you direct the drawing, the computer will also help with the drawing.
Create a setup() that defines the sketch size and the background color
void setup() {
size(600,600);
background(255);
}
void draw() {
if (mousePressed) {
for (int i = 0; i < 10 ; i ++) { //draw 600 blades every second
//the counter starts at 0 and ends at 10. The i++ command tells Processing to add to the counter each cycle.
stroke( 0, random(150,255), 0); //randomize the shade of green
line(mouseX, mouseY, pmouseX, pmouseY);
line(mouseX, mouseY, mouseX + random(-10,10), mouseY - random (5,25)) ; //randomize the angle of tilt and how tall the grass is
}
}
}
#1 - Play around with the grass length and angle.
#2- Play around with the random tool and for loop to see if you can get any cool changes to the code.