Ads

airplane programming in c

 //____________WELCOME ALL OF YOU ON ROHIT TECH STUDY CHANNEL_______________//

//_____________>>>> C PROGRAM TO DRAW AIRPLANE ANIMATION <<<<______________//


#include <graphics.h>

#include <stdlib.h>

#include <stdio.h>

#include <conio.h>

#include <dos.h>

void drawplane(int);

int main(void)

{


int gdriver = DETECT, gmode, errorcode; // request auto detection

int i,k;


 // initialize graphics and local variables

initgraph(&gdriver, &gmode,"c:\\tc\\bgi");


// read result of initialization

errorcode = graphresult();


   // an error occurred

   if (errorcode != grOk)

   {

      printf("Graphics error: %s\n", grapherrormsg(errorcode));

      printf("Press any key to halt:");

      getch();

      exit(1);

   }


   //diagram

   for(i=1;i<getmaxcolor();i++)

   {

      setcolor(i);

      drawplane(i);

      outtextxy(420,220,"AIR");

      outtextxy(450,218,"INDIA");

      setcolor(11);

      outtextxy(285,400,"MODIFIED BY---");

      outtextxy(400,400,"ROHIT TECH STUDY");


      for(k=0;k<900;k++)

      {

      setcolor(random(15));

      outtextxy(random(k),random(175),".");

      }

      delay(800);

      cleardevice();

   }


   // clean UP

   getch();

   closegraph();

   return 0;

}


void drawplane(int n)

{

int i,j,k;

int poly[30];

   line(145,220, 475,175);

   arc(470,205,20,90,30);

   ellipse(500,210, 270,95,15,15);

   line(200,260,265,250);

   line(350,240,500,225);

   line(350,240,200,375);

   line(200,375,175,380);

   line(175,380,270,270);

   line(270,270,270,260);

   line(270,260,260,240);

   line(260,240,340,230);

   line(340,230,350,240);

   line(340,230,195,375);


   line(200,260,100,250);

   line(100,250,100,230);

   line(100,230,110,220);


   line(110,225,90,150);

   line(90,150,110,150);

   line(110,150,150,225);

   line(150,225,110,225);

   line(95,170,105,170);

   line(105,170,130,225);


   line(105,245,60,275);

   line(60,275,75,275);

   line(75,275,150,245);

   line(150,245,105,245);

   line(115,245,65,275);


   for(i=0,j=200,k=235;i<12;i++)

   {

      setcolor(n);

      rectangle(j,k,j+10,k+5);

      j=j+20;

      if(j>200)

      k=k-3;

   }

   setcolor(n);

   rectangle(400,205,410,230);

   poly[0]=487;

   poly[1]=180;

   poly[2]=470;

   poly[3]=180;

   poly[4]=475;

   poly[5]=190;

   poly[6]=495;

   poly[7]=190;

   drawpoly(4,poly);

}


//_______<<<<<<<____I HOPE YOU LIKE THIS PROGRAM_______>>>>>>>>>>>_________//watch airplane coding video

Post a Comment

0 Comments