xxxxxxxxxx
47
let isTouched = false;
function setup() {
createCanvas(windowWidth, windowHeight);
textSize(60);
textAlign(CENTER);
fill(255);
ellipseMode(CENTER);
pixelDensity(displayDensity());
}
function draw() {
background(25);
if (touches.length == 1){
for(let i = 0; i < touches.length; i++){
ellipse(touches[i].x, touches[i].y, 50,50);
fill(40*i, 300, 100);
}
ellipse(width/2, height/2, 150,150);
}
else if (touches.length ==2){
rect(100,150, 160, 200);
}
else if (touches.length ==3){
ellipse (200,240,300,600);
}
else if (touches.length ==4){
rect (400,640,300,20);
}
else if (touches.length ==5){
ellipse (100,340,600,300);
}
}
function touchStarted(){
isTouched = true;
return false;
}
function touchEnded() {
isTouched = false;
return false;
}