Wednesday, 19 February 2014

MOVING CAR



/***************************************************************************/


#include<graphics.h>
#include<dos.h>
#include<conio.h>

main()
{
   int i,gd=DETECT,gm;

   initgraph(&gd,&gm,"");

   for(i=0;!kbhit();i=i+10)
   {
      rectangle(i,300,100+i,400);
      rectangle(100+i,350,150+i,400);
      circle(25+i,410,10);
      circle(125+i,410,10);
      line(0,420,639,420);
      delay(50);

      if(i==420)
                 i=0;
      clearviewport();
   }

   getch();
   closegraph();
   return 0;
}
/****************************************************************************/


No comments:

Post a Comment