raja
12-25-2001, 11:49 PM
Sirs,
I am new student of c++,I draw a car using graphics but i don't know,how
to move a car from left to right or right to left.
here is my coding follows, and please help me to move a car from one location
to another with
my codings.
--------------------------------------------------------------------------------------------
#include<conio.h>
#include<dos.h>
#include<graphics.h>
#include<stdio.h>
int main(void)
{
int gdriver=DETECT,gmode,i,s;
initgraph(&gdriver,&gmode,"");
setcolor(10);
line(220,100,275,100);
line(275,100,305,140);
line(305,140,340,150);
line(340,150,340,180);
line(340,180,100,180);
line(220,100,220,150);
line(220,150,100,150);
line(100,150,100,180);
setcolor(11);
setlinestyle(0,0,0);
circle(130,180,15);
circle(130,180,12);
circle(300,180,15);
circle(300,180,12);
setcolor(11);
setfillstyle(1,3);
line(10,195,700,195);
getch();
closegraph();
return 0;
}
----------------------------------------------------------------
the output will be look like this,
thanking you.
I am new student of c++,I draw a car using graphics but i don't know,how
to move a car from left to right or right to left.
here is my coding follows, and please help me to move a car from one location
to another with
my codings.
--------------------------------------------------------------------------------------------
#include<conio.h>
#include<dos.h>
#include<graphics.h>
#include<stdio.h>
int main(void)
{
int gdriver=DETECT,gmode,i,s;
initgraph(&gdriver,&gmode,"");
setcolor(10);
line(220,100,275,100);
line(275,100,305,140);
line(305,140,340,150);
line(340,150,340,180);
line(340,180,100,180);
line(220,100,220,150);
line(220,150,100,150);
line(100,150,100,180);
setcolor(11);
setlinestyle(0,0,0);
circle(130,180,15);
circle(130,180,12);
circle(300,180,15);
circle(300,180,12);
setcolor(11);
setfillstyle(1,3);
line(10,195,700,195);
getch();
closegraph();
return 0;
}
----------------------------------------------------------------
the output will be look like this,
thanking you.