Thanks guys. I'm gonna use the same boolean if-statement format that I used for my boolean variable "isPressed" (to determine if a, b, c or d is pressed).
So I have:
Code:
if (key == 'h') {
if (help == true) {
help = false;
}
else {
help = true;
}
background(125, 0, 0);
textFont(Perpetua, 30);
text("Test", 0, 25);
}
I keep my keyReleased() method the same:
Code:
void keyReleased() {
response = null;
}
Yet when I press "h", the screen appears white, and stops being white when I release "h". I set the background to be red, so I don't know why it would be white (as default?).
The word "Test" is only flashed when I press/release "h". I think the problem has to do with it not being in draw(), but it shouldn't be, because it's its own function.
My other boolean variable, isPressed, works just fine:
Code:
if (key == 'a' || key == 'b' || key == 'c' || key =='d') {
if (isPressed == true) {
isPressed = false;
}
else {
isPressed = true;
}
response = tactic[tNumber].checkAnswer(key);
background(125, 0, 0);
fill(255);
text(response, 0, 25);
if (response == "Correct.") {
tNumber = tNumber + 1;
}
}
Any ideas?