We are about to switch to a new forum software. Until then we have removed the registration on this forum.
I want it to stop at 100 dots.
float a;
float b;
int dotNumber = 0;
void setup() {
size(200, 200);
background(255);
}
void draw() {
strokeWeight(3);
a = random(200);
b = random(200);
dotNumber = 0;
while(dotNumber < 100) {
point(a, b);
dotNumber = dotNumber + 1;
print(dotNumber);
}
}
Answers
Format your code. Edit post, select code and hit ctrl+o.
Regarding your question. Draw is executed about 30 fps. In your code, you are calling a for loop that creates 100 points 60 times per second. I modified your code to do what you want:
Think of draw() as a while loop. I hope this helps.
Kf
Thanks alot!!!