//Animated Truck
#include<stdio.h>
#include<conio.h>
#include<graphics.h>
void main()
{
int i,gd=DETECT,gm,midx,midy,j;
initgraph(&gd,&gm,"c:\\turboc3\\bgi");
midx=getmaxx()/2;midy=getmaxy()/2;
for(i=1;i<=300;i++)
{
line(40+i,380,77+i,380);
line(123+i,380,187+i,380);
line(233+i,380,247+i,380);
line(293+i,380,316+i,380);
line(40+i,380,40+i,310);
for(j=1;j<=30;j=j+4)
{
line(40+i,310+j,240+i,310+j);
}
line(240+i,380,240+i,280);
arc(210+i,380,0,68,100);
arc(210+i,380,0,70,107);
rectangle(240+i,280,247+i,380);
arc(100+i,380,0,180,23);
arc(210+i,380,0,180,23);
arc(270+i,380,0,180,23);
setfillstyle(4,YELLOW);
fillellipse(100+i,380,20,20);
fillellipse(210+i,380,20,20);
fillellipse(270+i,380,20,20);
setfillstyle(9,6);
bar(0,400,getmaxx(),415);
if(i==300)
break;
clearviewport();
}
getch();
closegraph();
}
No comments:
Post a Comment
Note: only a member of this blog may post a comment.