xxxxxxxxxx
var check = 0;
function setup() {
createCanvas(windowWidth, windowHeight);
}
function draw() {
background(255);
if(check==1)
{
ellipse(random(width), random(height), random(50), random(50));
}
else {
rect(random(width), random(height), random(50), random(50));
}
if(check==0) fill(255,0,0);
if(check==1) fill(0,255,0);
rect(100, 100, 50, 50);
}
function mouseClicked()
{
if(mouseX>100&&mouseY>100&&mouseX<150&&mouseY<150) check = 1-check;
}