Program in C for Moving Car Animation Using C Graphics
#include<stdio.h> #include<conio.h> #include<graphics.h> #include<dos.h> int main() { int gdriver = DETECT,gmode; int x,y,i; initgraph(&gdriver,&gmode,"C:\\TC\\BGI"); x=getmaxx(); outtextxy(250,250,"Press any key to continue."); getch(); for(i=0;i<x;i++) { setcolor(YELLOW); arc(39+i,263,0,185,20); setfillstyle(SOLID_FILL,RED); circle(40+i,266,15); floodfill(41+i,267,14); arc(139+i,263,0,185,20); // setfillstyle(SOLID_FILL,RED); circle(140+i,266,15); floodfill(141+i,267,14); //left line(1+i,240,1+i,266); line(1+i,266,17+i,266); //middle line(60+i,266,120+i,266); line(160+i,266,220+i,266); line(220+i,240,220+i,266); line(190+i,230,220+i,240); line(160+i,200,190+i,230); //top line(50+i,200,160+i,200); line(1+i,240,20+i,230); line(20+i,230,50+i,200); //road setcolor(15); line(0,280,x,280); //door setcolor(YELLOW); outtextxy(200,350,"DEVELOPED BY OM PRAKASH KARTIK"); delay(30); cleardevice(); } getch(); }
Output:-
Related Programs
- Draw a circle using C Graphics
- Draw a fill color in circle using C Graphics
- Draw a cube in C Using Graphics
0 Comments