Monday, 9 May 2011

Research on If/Else 3rd

int counter=0;
int shrink=0;
int side=0;
int up=0;
int timing=10;


void setup()
{
 
  background(127);
  size (500,500);
  stroke(0);
}
void draw()



{
 
rect(counter,50,50,50);
counter= counter +1;

if (counter>timing)
{
rect(50,shrink,50,50);
shrink= shrink +1;

if (shrink>timing)
{rect(side,400,50,50);
side= side +1;

if (side>timing)
{rect(400,up,50,50);
up= up +1;}}}

}

No comments:

Post a Comment