xxxxxxxxxx
46
let dia = 100;
let spray = 50;
function setup() {
createCanvas(800, 800);
background("pink");
fill("green");
}
function draw() {
}
function mouseDragged(){
noStroke();
circle(mouseX,mouseY,dia);
circle(width-mouseX,mouseY,dia);
circle(mouseX,height-mouseY,dia);
circle(width-mouseX,height-mouseY,dia);
}
function keyPressed(){
if (key == " "){
background("pink");
}
else if (key == "1"){
fill("pink")
}
else if(key == "2"){
fill("green")
}
else if (key == "r"){
fill(random(255), random(255), random(255))
}
else if(keyCode == UP_ARROW){
dia = dia +5;
}
else if (keyCode == DOWN_ARROW){
dia = dia-5;
}
}
function sprayCan(x,y,d){
circle(x+rando(-spray, ))
}