Thursday 23 August 2012

Code Development

 Below is what is likely to create my final code. I have done a lot of work at Tuesday's tutorial (21/8/2012) and also at home, having downloaded processing.


void setup() {
  size (400,800);
  background (142,0,28);
  smooth ();

 
int x=0;
int y=0;
int r=10;
int d=4;

  while (y<800){
  while (x<400){


   
//tri 
    float rand=random (0,2);
    if (rand<1)
            {
    fill (200,190,140);
            }
       else {
    fill(251,247,228);
            }
       triangle (x+30-d,y+40,x+30+d,y+40,x+30,y+2);
   
//quad   
    float ran=random (0,2);
    if (ran<1)
            {
           fill (120,120,120);
            }
       else {
                  fill(66,66,66);
            }
    quad (random (x-r,x+r),random (y-r,y+r),random(x-r,x+r),random(y+20-r,y+20+r),random(x+20-r,x+20+r),random(y+20-r,y+20+r),random(x+20-r,x+20+r),random(y-r,y+r));
   
   
    x=x+40;
  }
  x=0;
 y=y+40;
  }

}

No comments:

Post a Comment