// Draw Rocket Using C++ Graphic
#include<iostream.h>
#include<conio.h>
#include<dos.h>
#include<stdlib.h>
#include<graphics.h>
void main()
{
int gd=DETECT,gm;
initgraph(&gd,&gm,"c:\\tc\\bgi");
for(int i=0;i<400;i++)
{
// Body- upper Part
setcolor(15);
line(122,172-i,100,199-i);
line(122,172-i,150,199-i);
line(100,199-i,150,199-i);
rectangle(100,200-i,150,300-i);
//Name
outtextxy(124,220-i,"I");
outtextxy(124,240-i,"S");
outtextxy(124,260-i,"R");
outtextxy(124,280-i,"O");
//Body- Center Part
rectangle(100,300-i,150,400-i);
rectangle(90,300-i,100,400-i);
rectangle(150,300-i,160,400-i);
// Body- Lower Part
line(122,399-i,100,429-i);
line(122,399-i,150,429-i);
ellipse(125,434-i,0,360,27,8);
//Fire
setcolor(YELLOW);
for(int t=0;t<70;t++)
{
line(150,430-i,150,440-i+t);
line(147,430-i,147,440-i+t);
line(144,430-i,144,440-i+t);
line(140,430-i,140,440-i+t);
line(137,430-i,137,440-i+t);
line(134,430-i,134,440-i+t);
line(130,430-i,130,440-i+t);
line(127,430-i,127,440-i+t);
line(123,430-i,123,440-i+t);
line(120,430-i,120,440-i+t);
line(117,430-i,117,440-i+t);
line(113,430-i,113,440-i+t);
line(110,430-i,110,440-i+t);
line(107,430-i,107,440-i+t);
line(103,430-i,103,440-i+t);
line(100,430-i,100,440-i+t);
continue;
}
delay(5);
cleardevice();
}
getch();
closegraph();
}
Comments
Post a Comment