Display shape one after the other in a loop
in
Programming Questions
•
1 year ago
I try to display these ellipses one after the other but the for loop calculates the positions of all of them then puts them up all at once. How do you get it to display one, then two, then three....etc.? I tried putting a delay() in the loop but that doesn't work.
- void cascade(String[] sqMove) {
- for(int i=0; i<sqMove.length; i++) {
- float[] pieces = float(split(sqMove[i], ' '));
- displayDrop(pieces[0], pieces[1]);
- //RedrawSquare(sqMove[i-1]);
- println(i);
- delay(300);
- }
- //cascading = false;
- }
- void displayDrop(float posX, float posY) {
- fill(82,86,240);
- ellipseMode(CENTER);
- ellipse(posX, posY, electSize, electSize);
- }
- }
1