xxxxxxxxxx
47
let inTouch = false;
function setup() {
createCanvas(windowWidth, windowHeight);
pixelDensity(displayDensity());
textAlign(CENTER);
fill(255);
colorMode(HSB);
}
function draw() {
background(119, 0, 29);
fill(0,0,0);
rect(50,50,520,800);
fill(146,100,32);
rect(75,75,470,800);
textSize(50);
fill(132,100,91);
text("Mission Control",310,130);
if (inTouch) {
if (touches.length > 2) {
for (let i = 0; i < touches.length; i++) {
fill(132, 100, 91);
ellipse(touches[i].x, touches[i].y, 150, 150);
}
fill(132, 100, 91);
textSize(160);
text("LAUNCH", width / 2, height / 2);
} else {
fill(0,100,93);
textSize(160)
text("ERROR", width / 2, height / 2);
}
}
}
function touchStarted() {
inTouch = true;
return false;
}
function touchEnded() {
inTouch = false;
return false;
}