Wednesday, 15 February 2012

karims new :)


int x1=0;
int x2=400;
int y1=0;
int y2=0;
int y3=400;
int dx=1;
int dy=1;
void setup()
{
size(400,400);
}
void draw()
{
   background(random(255),random(255),random(255));

fill(229,30,30);
ellipse(x1,y1,30,30);
x1+=dx;
y1+=dy;
if((x1>=width/2||y1>=height/2)||(x1<=0||y1<=0))
{
  dx=(-1)*dx;
  dy=(-1)*dy;
  }
  fill(30,299,31);
ellipse(x2,y2,30,30);
x2-=dx;
y2+=dy;

fill(30,41,299);
ellipse(x1,x2,30,30);
fill(23,23,13);
ellipse(x2,x2,30,30);
}

No comments:

Post a Comment