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
|
#include <graphics.h>
#include <dos.h>
int main()
{
int i, j = 3, gd = DETECT, gm;
initgraph(&gd,&gm,"C:\\TC\\BGI");
settextstyle(COMPLEX_FONT,HORIZ_DIR,2);
outtextxy(45,240," Press any key to view the moving car");
getch();
settextstyle(COMPLEX_FONT,HORIZ_DIR,1);
for( i = 0 ; i <= 420 ; i = i + 10, j++)
{
rectangle(50+i,275,245+i,400);
outtextxy(65+i,280,"J's Bussing Inc.");
rectangle(255+i,355,285+i,370);
rectangle(245+i,350,295+i,400);
circle(75+i,410,10);
circle(225+i,410,10);
setcolor(j);
delay(100);
if( i == 420 )
break;
if ( j == 3 )
j = 2;
cleardevice(); /// clear screen
}
delay(1500);
closegraph();
return 0;
}
| |