4、腾飞的火箭
腾飞的火箭也是一幅动画。程序运行时首先在屏幕上出现大地和校园,然后一枚火箭冉冉升起,同时喷出红色的火焰。
/*腾飞的火箭QW44.C*/
#include<graphics.h>
#include<fcntl.h>
#include<stdio.h>
void main()
{
int i,j,x=140,y;
int driver=DETECT;
int mode=0;
initgraph(&driver,&mode,"\\tc3\\bgi");
setbkcolor(7);
setfillstyle(SOLID_FILL,2);
bar(0,400,639,479);
setcolor(10);
moveto(125,240);
lineto(190,345);
lineto(129,343);
lineto(116,399);
lineto(121,343);
lineto(70,345);
lineto(125,240);
setfillstyle(1,2);
floodfill(127,250,10);
moveto(50,290);
lineto(70,355);
lineto(54,353);
lineto(56,399);
lineto(43,399);
lineto(46,353);
lineto(30,355);
lineto(50,290);
moveto(20,350);
lineto(25,375);
lineto(24,353);
lineto(26,399);
lineto(13,399);
lineto(16,353);
lineto(15,375);
lineto(20,350);
moveto(585,290);
lineto(605,355);
lineto(589,353);
lineto(591,399);
lineto(579,399);
lineto(581,353);
lineto(565,355);
lineto(585,290);
setfillstyle(1,2);
floodfill(50,300,10);
floodfill(20,360,10);
floodfill(585,295,10);
setcolor(14);
line(0,400,639,400);
line(0,405,639,405);
line(0,405,639,415);
line(0,430,639,430);
line(0,450,639,450);
line(0,479,639,479);
line(0,405,30,400);
line(0,430,130,400);
line(0,479,200,400);
line(120,479,245,400);
line(210,479,280,400);
line(280,479,310,400);
line(320,479,320,400);
line(360,479,330,400);
line(430,479,360,400);
line(520,479,395,400);
line(639,479,439,400);
line(639,430,509,400);
line(639,405,609,400);
setcolor(8);
moveto(195,180);
lineto(195,398);
lineto(150,398);
lineto(150,180);
lineto(195,180);
lineto(213,195);
lineto(213,398);
lineto(195,398);
setfillstyle(SOLID_FILL,15);
floodfill(170,250,8);
setfillstyle(SOLID_FILL,1);
floodfill(200,250,8);
setcolor(12);
arc(320,421,25,155,55);
line(270,398,370,398);
setfillstyle(SOLID_FILL,12);
floodfill(320,395,12);
setcolor(8);
moveto(450,398);
lineto(450,120);
lineto(465,125);
lineto(500,185);
lineto(485,180);
lineto(450,120);
arc(635,200,172,275,151);
arc(634,200,173,275,135);
circle(508,275,25);
arc(518,275,-40,52,27);
line(508,248,537,255);
line(518,298,537,293);
line(639,320,639,400);
line(450,399,639,399);
setcolor(4);
arc(635,200,202,220,151);
arc(634,200,202,219,135);
setcolor(1);
arc(634,200,220,224,135);
setfillstyle(SOLID_FILL,15);
floodfill(500,380,8);
setfillstyle(SOLID_FILL,9);
floodfill(635,345,8);
floodfill(460,130,8);
floodfill(540,270,8);
floodfill(500,250,8);
floodfill(525,295,8);
setfillstyle(SOLID_FILL,12);
floodfill(500,270,8);
setcolor(8);
line(450,180,450,225);
line(195,18,195,210);
line(195,180,450,180);
line(213,225,450,225);
line(195,210,450,210);
line(195,210,213,225);
setfillstyle(1,15);
floodfill(200,200,8);
floodfill(240,200,8);
setfillstyle(1,9);
floodfill(210,220,8);
floodfill(240,220,8);
setcolor(15);
line(195,180,195,210);
line(195,180,213,195);
line(213,195,213,210);
setcolor(9);
line(213,210,213,225);
setcolor(15);
for(i=1;i<=30;i++)
{
moveto(240,x);
lineto(230,x+15);
lineto(250,x+15);
lineto(240,x);
moveto(230,x+15);
lineto(230,x+50);
lineto(225,x+55);
lineto(225,x+155);
lineto(255,x+155);
lineto(255,x+55);
lineto(250,x+50);
lineto(250,x+15);
moveto(225,x+140);
lineto(220,x+148);
lineto(220,x+155);
lineto(260,x+155);
lineto(260,x+148);
lineto(255,x+140);
line(255,x+55,255,x+55);
setfillstyle(SOLID_FILL,9);
floodfill(240,x+14,15);
setfillstyle(SOLID_FILL,8);
floodfill(241,x+49,15);
setfillstyle(SOLID_FILL,15);
floodfill(240,x+154,15);
setfillstyle(SOLID_FILL,11);
floodfill(223,x+154,15);
floodfill(258,x+154,15);
setcolor(6);
setfillstyle(1,7);
bar(265,300,305,320);
setcolor(15);
moveto(240,x+156);
lineto(225,x+170);
lineto(240,x+250);
lineto(255,x+170);
lineto(240,x+156);
lineto(230,x+175);
lineto(240,x+230);
lineto(250,x+175);
lineto(240,x+156);
moveto(240,x+158);
lineto(234,x+185);
lineto(240,x+210);
lineto(246,x+185);
lineto(240,x+158);
setfillstyle(SOLID_FILL,12);
floodfill(240,x+245,15);
setfillstyle(SOLID_FILL,13);
floodfill(241,x+215,15);
setfillstyle(SOLID_FILL,14);
floodfill(24