Home   Easy-Code    Forum  Updater 
Twitter Facebook



Flight using c graphics

Critics Rating:

Users Rating:



          /* FLIGHT */



#include <stdio.h>

#include <graphics.h>

#include <stdlib.h>

main()

{

int g,s,x=500,y=400,m,k,z,f,x2=300,y2=50,x1=1,y1=400;

detectgraph(&g,&m);

initgraph(&g,&m," ");

for(;x1<600;x1+=2)

{

cleardevice();

line(5,420,590,420);

sound(1000);

delay(10);

nosound();

line(x1,y1+10,x1+150,y1);

line(x1+90,y1-30,x1+150,y1);

line(x1+90,y1-30,x1+30,y1-10);

line(x1+30,y1-10,x1,y1-50);

line(x1,y1-50,x1,y1+10);

circle(x1+110,y1+13,8);

circle(x1+20,y1+15,5);

if(x1%3==0)

{

   line(x1+17,y1+15,x1+22,y1+15);

   line(x1+105,y1+13,x1+115,y1+13);

}

else

{

   line(x1+20,y1+12,x1+20,y1+18);

   line(x1+110,y1+7,x1+110,y1+20);

}

}

x1=1;

y1=350;

for(;x1<600;x1+=2,y1--)

{

cleardevice();

sound(4000);

line(x1,y1+50,x1+150,y1);

line(x1+150,y1,x1+90,y1-20);

line(x1+90,y1-20,x1+30,y1+20);

line(x1+30,y1+20,x1,y1-30);

line(x1,y1-30,x1,y1+50);

nosound();

}

x1=10;

y1=50;

cleardevice();

for(s=0;s<=20;s++)

{

for(z=0,x2=350;z<20 && y>50;z++,x2-=25,x1++)

{

   cleardevice();

   sound(2000);

   line(x1,y1+20,x1+150,y1);

   line(x1+90,y1-30,x1+150,y1);

   line(x1+90,y1-30,x1+30,y1-10);

   line(x1+30,y1-10,x1,y1-50);

   line(x1,y1-50,x1,y1+20);

   circle(x2+350,y2+40,20);

   circle(x2+150,y2+20,20);

   circle(x2+20,y2+50,10);

   circle(x2-50,y2-20,25);

   arc(x2+300,y2+40,0,180,50);

   arc(x2+220,y2+50,0,180,30);

   arc(x2+290,y2+50,180,0,60);

   arc(x2+210,y2+50,180,0,20);

   arc(x2+50,y2+180,0,180,30);

   arc(x2+10,y2+190,0,180,10);

   arc(x2+55,y2+190,180,0,25);

   arc(x2+17,y2+190,180,0,15);

   nosound();

   if(x1>300)

   {

    cleardevice();

    line(500,400,515,470);

    line(520,400,535,470);

    ellipse(510,400,20,340,10,3);

    circle(x,y,7);

    fillellipse(x,y,7,7);

    y-=3;

    if(y%4==0)

    x--;

   }

}

}

for(x2=420;y1<=340;y1++)

{

cleardevice();

arc(x1,y1,0,180,70);

line(x1-70,y1,x1-15,y1+90);

line(x1+70,y1,x1+5,y1+90);

line(x1-15,y1+90,x1-10,y1+110);

line(x1+5,y1+90,x1,y1+110);

circle(x1-5,y1+104,5);

rectangle(x1-10,y1+110,x1,y1+130);

line(x1-10,y1+130,x2-15,y1+140);

line(x1,y1+130,x2+5,y1+140);

if(y1%5==0)

   x2+=5;

if(y1%10==0)

   x2-=10;

}

getch();

closegraph();

}

Courtesy, Source, References & Regards: Kishore AVGK

While using this site, you agree to have read and accepted our terms of use and privacy policy.
Copyright@2009-2011 by KuGuNi.com. All Rights Reserved.