'key pressed' Inside Voide setup??
in
Programming Questions
•
1 year ago
Hello ,
I have this
void setup () {
....
....
int i = 0;
while (i < 1000) {
x[i] = width;
y[i] = random(height);
speed[i] = random(0.3, sped);
i = i + 1;
}
}
I want to use :
if (keyPressed) {
if (key == 's' || key == 'S')
sped = sped + 0.05;
println(sped);
}
Where should I insert the if statement to work?
inside void setup or draw??
1