Object instances with for loop
in
Programming Questions
•
7 months ago
Hi guys, been trying to get my for loop working, I'm quite new to this so apologies if my code seems dumb!
If you want to see what I'm trying to duplicate then remove my for loop. Nearly been pulling my hair out on this.. any heads up?
- void setup(){
- size(480,120);
- smooth();
- }
- void draw(){
- background(#6B8E23);
- for(int i=0; i>3; i++) {
- owl(110, 110);
- owl(240, 110);
- }
- }
- void owl(int x, int y){
- pushMatrix();
- translate(x, y);
- stroke(#8B4513);
- strokeWeight(70);
- fill(128);
- line(0, -35, 0, -65);
- noStroke();
- fill (#FFE4C4);
- ellipse(-17.5, -65, 35, 35); //right eye dome
- ellipse(17.5, -65, 35, 35); //left eye dome
- arc(0, -65, 70, 70, 0, PI); //chin
- fill(0);
- ellipse(-14, -65, 8, 8); //left eye
- ellipse(14, -65, 8 ,8);
- fill(#800000);
- quad(0, -58, 4, -51, 0, -44, -4, -51);
- popMatrix();
- }
1