#include "graphics.h"
int main( )
{
initwindow(1000, 700, "Animation");
for(int i=0;i<47;i++) //for +x-axis
{
line(500,0,500,1000);
line(0,350,1000,350);
circle(530+(i*10),320,30);
delay(100);
clearviewport();
}
for(int i=0;i<47;i++) //for -x-axis
{
line(500,0,500,1000);
line(0,350,1000,350);
circle(0+(i*10),320,30);
delay(100);
clearviewport();
}
for(int i=0;i<32;i++) //for +y-axis
{
line(500,0,500,1000);
line(0,350,1000,350);
circle(470,320-(i*10),30);
delay(100);
clearviewport();
}
for(int i=0;i<32;i++) //for -y-axis
{
line(500,0,500,1000);
line(0,350,1000,350);
circle(470,700-(i*10),30);
delay(100);
clearviewport();
}
while(!kbhit())
{
outtextxy(500,350,"Press any key to exit...");
delay(100);
}
return 0;
}
Comments
Post a Comment