xxxxxxxxxx
22
function setup() {
createCanvas(400, 400);
}
function draw() {
if (mouseIsPressed) {
point(mouseX, mouseY);
}
}
function keyPressed() {
if (key == 's') {
save("ex.png");
}
if (key == 'b') {
background(random(255), random(255), random(255));
}
if (key == 'c') {
stroke(random(255), random(255), random(255));
line(0, 0, width, 0);
}
}