xxxxxxxxxx
function setup() {
createCanvas(windowWidth,windowHeight);
background(255)
}
function draw() {
//Mausrad
if(mouseIsPressed){
if(mouseButton==CENTER){
background(0,1)
rectMode(CENTER)
translate(mouseX,mouseY)
rect(random(5),random(25),random(50),20)
stroke(255,80)
noFill()
ellipse(0,0,100,100)
stroke(220,10,60)}
}
//Linke Maustaste
if(mouseIsPressed){
if(mouseButton==LEFT){
rectMode(CENTER)
translate(mouseX,mouseY)
rotate(random(PI))
rect(0,0,55,55)
stroke(5, 5, 5, 80)
fill(random(255))
noFill()
ellipse(0, 0, 50, 50)
stroke(170,30,80,70);
//noStroke();
fill(190, 0, 100,50)
noFill()
}
}
//Rechte Maustaste
if(mouseIsPressed){
if(mouseButton==RIGHT){
rectMode(CENTER)
translate(mouseX,mouseY)
rect(random(50),random(50),random(50),0)
stroke(50)
ellipse(0,0,20,20)
stroke(170,30,80)}
}
//Hintergrundreset
if(keyIsPressed){
background(255)}
}