PFont mono;
float x;
float y;
boolean treme1 =false;
boolean treme2 =false;
boolean treme3 =false;
boolean treme4 =false;
boolean treme5 =false;
boolean treme6 =false;
int startTime1;
int startTime2;
int startTime3;
int startTime4;
int startTime5;
int startTime6;
void setup() {
size(720, 480);
background(0);
mono = createFont("Helvetica", 100);
textFont(mono);
text("Ê", 90, 270);
text("X", 190, 270);
text("T", 295, 270);
text("A", 385, 270);
text("S", 480, 270);
text("E", 580, 270);
}
void draw() {
if (millis()>startTime1+2000) {
treme1=false;
startTime1=0;
}
if (millis()>startTime2+2000) {
treme2=false;
startTime2=0;
}
if (millis()>startTime3+2000) {
treme3=false;
startTime3=0;
}
if (millis()>startTime4+2000) {
treme4=false;
startTime4=0;
}
if (millis()>startTime5+2000) {
treme5=false;
startTime5=0;
}
if (millis()>startTime6+2000) {
treme6=false;
startTime6=0;
}
if (mouseX>85 && 95<mouseX && mouseY>220 && 320>mouseY) {
startTime1=millis();
treme1=true;
}
if (treme1) {
fill(0);
rect(85, 160, 80, 150);
fill(random(255), random(255), random(255));
text("Ê", 90+random(-10, 10), 270+random(-10, 10));
}
if (mouseX>185 && 195<mouseX && mouseY>220 && 320>mouseY) {
startTime2=millis();
treme2=true;
}
if (treme2) {
fill(0);
rect(180, 160, 85, 150);
fill(random(255), random(255), random(255));
text("X", 190+random(-10, 10), 270+random(-10, 10));
}
if (mouseX>290 && 300<mouseX && mouseY>220 && 320>mouseY) {
startTime3=millis();
treme3=true;
}
if (treme3) {
fill(0);
rect(280, 140, 85, 150);
fill(random(255), random(255), random(255));
text("T", 295+random(-10, 10), 270+random(-10, 10));
}
if (mouseX>380 && 390<mouseX && mouseY>220 && 320>mouseY) {
startTime4=millis();
treme4=true;
}
if (treme4) {
fill(0);
rect(370, 140, 90, 150);
fill(random(255), random(255), random(255));
text("A", 385+random(-10, 10), 270+random(-10, 10));
}
if (mouseX>475 && 480<mouseX && mouseY>220 && 320>mouseY) {
startTime5=millis();
treme5=true;
}
if (treme5) {
fill(0);
rect(475, 140, 90, 150);
fill(random(255), random(255), random(255));
text("S", 480+random(-10, 10), 270+random(-10, 10));
}
if (mouseX>575 && 585<mouseX && mouseY>220 && 320>mouseY) {
startTime6=millis();
treme6=true;
}
if (treme6) {
fill(0);
rect(575, 140, 90, 150);
fill(random(255), random(255), random(255));
text("E", 580+random(-10, 10), 270+random(-10, 10));
}
}
I can’t seem to pass over the letter “T” for example without the letters before start shaking as well…