Loops

Loop

whoever else can make this using For loops is a wizard

Comments

  • Here's mine ;)

    picture

  • Am I did this right? Can someone help me with my code?

        void setup() {
          size(500, 500);
          noLoop();
          noStroke();
        }
    
        void draw() {
          background(0, 255, 255);
          fill(255, 255, 0); 
          ellipse(250, 250, 250, 250);
          fill(0, 200, 0);
          rect(0, 250, 500, 250);
          for(int y=220; y<height+50; y+=20) {
            for(int x=-50; x<width; x+=40) {
              x += int(random(0, 20));
              y += int(random(-5, 5));
              makePeople(x, y);
            } 
          } 
        }
    
        void makePeople(int x, int y) {
          color person = lerpColor(#FFD66F, #B77202, random(0, 500)/500.0);
                person = lerpColor(person, #000000, (float(y)-250.0)/500.0);
          fill(person);
          ellipse(x, y, 10+random(-5,5), 10+random(-5,5));
          rect(x-10, y+5, 20, 40);
        }
    
Sign In or Register to comment.