In processing, how does one de-activate keypresses from effecting what happens.
I've looked all over the processing website and I cannot figure this out.
You can leave an optional "tip" with Mahalo's virtual currency, Mahalo Dollars. If you are asking a difficult question that might require some research, or if you'd like a wide variety of feedback, a higher tip often leads to more answers to your question.
M$2 Answers
void draw(){
char key = keyPressed;
if ((key == 'b' && player == 1)||(key == 'B' && player == 1)){
fill(0);
rect(25, 25, 50, 50);
}
}
Duplicate this for the other player to trigger only on their turn.
I just learning to program
You can leave an optional "tip" with Mahalo's virtual currency, Mahalo Dollars. If you are asking a difficult question that might require some research, or if you'd like a wide variety of feedback, a higher tip often leads to more answers to your question.
M$This function only reacts to the letter B or b, everything else is ignored.
void draw() {
if(keyPressed) {
if (key == 'b' || key == 'B') {
fill(0);
rect(25, 25, 50, 50);
}
}
}
You can leave an optional "tip" with Mahalo's virtual currency, Mahalo Dollars. If you are asking a difficult question that might require some research, or if you'd like a wide variety of feedback, a higher tip often leads to more answers to your question.
M$