-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmoving_car.cpp
59 lines (48 loc) · 1.1 KB
/
moving_car.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#include<stdio.h>
#include<conio.h>
#include<graphics.h>
#include<dos.h>
main()
{
int gd=DETECT,gm;
initgraph(&gd,&gm,"c:\\tc\\bgi");
for (int i=0;i<500;i++)
{
/** Sun**/
setcolor(YELLOW);
circle(100, 100, 30);
floodfill(100, 100, YELLOW);
/***CAR BODY ******/
line(50+i,370,90+i,370);
arc(110+i,370,0,180,20);
line(130+i,370,220+i,370);
arc(240+i,370,0,180,20);
line(260+i,370,300+i,370);
line(300+i,370,300+i,350);
line(300+i,350,240+i,330);
line(240+i,330,200+i,300);
line(200+i,300,110+i,300);
line(110+i,300,80+i,330);
line(80+i,330,50+i,340);
line(50+i,340,50+i,370);
/***CAR Windows***/
line(165+i,305,165+i,330);
line(165+i,330,230+i,330);
line(230+i,330,195+i,305);
line(195+i,305,165+i,305);
line(160+i,305,160+i,330);
line(160+i,330,95+i,330);
line(95+i,330,120+i,305);
line(120+i,305,160+i,305);
/**Wheels**/
circle(110+i,370,17);
circle(240+i,370,17);
delay(10);
cleardevice();
setcolor(GREEN);
/** Buildings **/
rectangle(25, 150, 70, 390);
rectangle(75, 250, 120, 390);
line(0,390,639,390); //ROAD
} getch();
}