SO, I'm a complete n00b when it comes to processing, only been working at it for a a day or so now, but i've come a cropper trying to write a script in which the 'QWERT' keys turn on an ellipse, but I can't get them to turn off. I want to have it so by pressing the same key again the respective ellipse is turned off. I've posted my code below. I have the feeling this is really simple, but any help would be much appreciated......THANKS!
boolean drawQ = false;
void setup() {
size(240,240);
background(#E0960B);
smooth();
}
void draw() {
if (keyPressed == true)
if ((key == 'q') || (key =='Q')) {
ellipse(100,100, 100, 100);
}
if ((key == 't') || (key == 'T')) {
ellipse(60,60,60,60);
}
if ((key == 'w') || (key == 'W')) {
ellipse(20,20,20,20);
}
if ((key == 'e') || (key == 'E')) {
ellipse(40,40,40,40);
}
if ((key == 'r') || (key == 'R')) {
ellipse(10,10,10,10);
}
}
void keyPressed() {
if (keyPressed == true)
if (key == ' ') {
background(#E0960B);
drawQ = true;
}
}
1