Trails

Moderator: BenChang

Trails

Postby BenChang » Tue Dec 02, 2014 6:44 pm

Code: Select all
Thing t;

void setup ()
{
   size(800,600);
    t= new Thing (300,10);
}


void draw ()
{
  background(255);
  t.draw();
}


Code: Select all
class Thing
{
   float x,y;
 
   Thing (float x, float y )
   {
      this.x=x;
      this.y=y;
   }
   
   void draw ()
   {
      y=y+2;
      noStroke();
     
      float y2;
      float a;
      for (a=0; a < 25; a ++)
      {     
        y2 = y - (25-a)*2 ;
       
        fill( 255,0,0,a*2);
        rect (x,y2,10,10);
      }
     
       fill( 255,0,0,255);
        rect (x,y,10,10);
     
   
   }

}
User avatar
BenChang
 
Posts: 176
Joined: Mon Jan 17, 2011 4:48 pm

Return to Art and Animation

Who is online

Users browsing this forum: No registered users and 1 guest

cron