Basically trying to get the second rectangle to stop at the x coordinate 100 and the first to stop at the x cordinate 649. But they both stop moving once the the second rectangle reaches x 100. Any ideas.
Thanks
- float x = 100;
- float y = -100;
- void setup() {
- size(700, 150);
- fill(0, 0, 0);
- rect(0, 50, 50, 50);
- fill(100, 15, 0);
- rect(-100, 50, 50, 50);
- }
- void draw() {
- background(200);
- fill(0, 250, 200, 200);
- rect(x, 50, 50, 50);
- {
- while (x > 649);
- x = x + 1;
- }
- fill(0, 0, 255, 250);
- rect(y, 50, 50, 50);
- {
- while (y > 100);
- y = y + 1;
- }
- }
1