//Shane Banner Septemeber 22, 2009
/*This program makes a river on a sunny day 
 filled with 10 randomly placed rocks and 5 randomly place birds*/
size(500,500);
/*This size can be changed without stuff messing up. 
 the rocks and birds are aloud to spill off the screen it looks
 natural. They can also over lap the river bank.*/

int h=height;
//This allows me to not have to type as much when I want to use height or width//
int w=width;

int b=0;
//Integer i and b are used as a counter//
int i;

int x;
//x and y are just used for random integers.//
int y;

int lx;
//lx and ly are for the wings of the bird//
int ly;

//Lets change the color mode to RGB//
colorMode(RGB,255,255,255);
//The sky will be cyan and everything will overlay it//
background(0,255,255);

noStroke();
//The Sun
//No lines around the sun and make it yellow//
fill(255,255,0);
ellipse(3*w/4,h/6,w/5,h/5);



stroke(0);
//Turn the stroke and lines back on so the river and bird lines can be seen//

//Now for the field//
fill(0,255,0);
rect(0,2*h/6,w,5*h/6);

//And the river//
fill(0,0,255);
rect(0, h/2,w,h/3);


//The for commands I find some what difficult.//
for(i=0; i<10; i++){
  //No lines on the rocks makes it look realer//
  noStroke();
  fill(50,50,50);
  y=(int)random(3*h/6,5*h/6);
  //These make the postions of the rocks random//
  x=(int)random(0,w);
  ellipse(x,y,h/10,w/10);
  // Three elipses makes the rock look iregular//
  ellipse(x-5,y+4,h/10,w/10); 
  ellipse(x+6,y+3,h/10,w/10);
}

/*I couldn't think of how else to use the for statement or while besides birds or flowers
 I've done flowers before so I did birds*/
for(b=0; b<5; b++){
  //Need more stroke for the bird's body//
  strokeWeight(3);
  //But you have to turn the strroke on first//
  stroke(0);
  lx=(int)random(0+w/10,w);
  //Random postions for the birds//
  ly=(int)random(0+h/10,h/3);

  line(lx,ly,lx+w/10,ly-h/10);
  //WINGS//
  line(lx,ly,lx-w/10,ly-h/10);
}

/* This program actually took a good while. The for and while commands
 confuse me some. I originally wanted to make a stick move down the
 stream, but you can't use for or while to animate so far that I know of.
 This progam was fun though.*/


