xxxxxxxxxx
function setup(){
createCanvas(windowWidth, windowHeight);
background(0);
}
function draw() {
translate(mouseX, mouseY);
rectMode(CENTER);
if (mouseIsPressed) {
if (mouseButton == LEFT) {
rotate(random(PI));
noFill();
stroke(0, 255, random(200));
rect(0, 0, 50, 50);
}
}
if (mouseIsPressed) {
if(mouseButton == RIGHT) {
background(0);
}
}
}