Monday 29 September 2014

C Animation for a Moving Kite

C Animation for a Moving Kite

#include<conio.h>
#include<stdio.h>
#include<graphics.h>
void main()
{
int i;
int gd=DETECT,gm;
initgraph(&gd,&gm,”C:\\TC\\bgi”);
line(250,200,200,250);
line(200,250,250,300);
line(250,300,300,250);
line(300,250,250,200);
line(250,300,225,325);
line(225,325,275,325);
line(275,325,250,300);
i=0;
while(i<200)
                {
                cleardevice();
                line(250-i,200-i,200-i,250-i);        
                line(200-i,250-i,250-i,300-i);
                line(250-i,300-i,300-i,250-i);
                line(300-i,250-i,250-i,200-i);
                line(250-i,300-i,225-i,325-i);
                line(225-i,325-i,275-i,325-i);
                line(275-i,325-i,250-i,300-i);
                i+=5;
                delay(100);
                }
getch();
closegraph();
}

No comments:

Donate