How do I use keyPressed to control the screen?
in
Programming Questions
•
11 months ago
Hello,
I am trying to write a program with using keyPressed.
My idea is the cubes on the screen would break and fall apart one press any keys on the key board.
How should I continue from here.
void setup() {
stroke(1);
size (500, 450);}
void draw() {
//frameRate (5);
for (int y=0;y<500;y+=20){
for(int x=0;x<500;x+=20){
fill((x+y+10)*0.2,120,100);
rect(x,y,25,25);
}
}
if (keyPressed ==true) {
}
}
thanks in advance.
SH
1