Program 7 code animation effect



#include<iostream.h>
#include<graphics.h>
#include<conio.h>
#include<dos.h>
void main()
{
int gd=DETECT,gm,poly[8],c;
initgraph(&gd,&gm,"");
poly[0]=250;
poly[1]=200;
poly[2]=200;
poly[3]=300;
poly[4]=300;
poly[5]=300;
poly[6]=250;
poly[7]=200;
setcolor(6);
setfillstyle(SOLID_FILL,11);
fillpoly(4,poly);
for(c=1;c<=50;c++)
{
poly[0]--;
poly[6]++;
drawpoly(4,poly);
delay(100);
}
getch();
for(c=1;c<=25;c++)
{
setcolor(6);
circle(250,250,75-c);
delay(100);
}
getch();
closegraph();
}

output:




No comments

Powered by Blogger.