//Manish
//weforyou
//contactus on
www.futureisclean.blogspot.in
//fbpage: we for
you
c program of moving car in computer graphics
#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
#include<graphics.h>
#include<dos.h>
void main()
{
int gd=DETECT,gm,x,y,i;
initgraph(&gd,&gm,"c:\\turboc3\\bgi");
x=getmaxx();
y=getmaxy();
for(i=0;i<=350;i++)
{
line(x/8+i,y/2,x/8+i,3*y/8);
line(x/8+i,3*y/8,3*x+i/16,3*y/8);
line(3*x/16+i,3*y/8,x/4+i,3*y/16);
line(x/4+i,3*y/16,x/2+i,3*y/16);
line(x/2+i,3*y/16,3*x/4+i,3*y/8);
line(3*x+i/4,3*y/8,3*x/4+i,y/2);
circle(x/4+i,y/2,30);
circle(x/2+i,y/2,30);
line(3*x/4+i,y/2,x/2+i,y/2);
line(x/8+i,y/2,x/2+i,y/2);
clearviewport();
}
delay(2);
getch();
}
No comments:
Post a Comment