xxxxxxxxxx
Circle[] circles = new Circle[500];
String passwordIn = "";
String incorrect = "Incorrect Password. (Hint: The password is definitely NOT 'bounce'.)";
String passwordOut[] = {
"bounce"
};
frameRate(200);
void setup() {
fullScreen();
for (int i = 0; i < circles.length; i++) {
fill();
circles[i] = new Circle(random(width), random(height), random(-3, 3), random(-3, 3), (int) random(0, 255), (int) random(0, 255), (int) random(0, 255));
}
passwordIn = prompt();
}
void draw() {
background(50);
detect();
}
void detect() {
if (passwordIn == passwordOut) {
textAlign(CENTER, CENTER);
textSize(30);
bounce();
} else {
textAlign(CENTER, CENTER);
textSize(30);
alert(incorrect);
exit();
}
}
void bounce() {
for (int i = 0; i < circles.length; i++) {
circles[i].move();
circles[i].display();
}
}