#include "stdafx.h"
#include <graphics.h>
#include <conio.h>
int main()
{
initgraph(640,480);
while(1)
{
for(int x=100;x<480;x+=20)
{
setcolor(YELLOW);//绘制黄线,绿色填充
setfillcolor(GREEN);
fillcircle(x,x,20); //填充
Sleep(1000);
setcolor(BLACK);
setfillcolor(BLACK);
fillcircle(x,x,20);
if(x>440)
{
int i=1;
for(int x=480;x<640;x+=20)
{
setcolor(YELLOW);//绘制黄线,绿色填充
setfillcolor(GREEN);
fillcircle(x,x-40*i,20); //填充
Sleep(1000);
setcolor(BLACK);
setfillcolor(BLACK);
fillcircle(x,x-40*i,20);
i++;
if(x>600)
{
int j=0;
for(int x=600;x>320;x-=20)
{
setcolor(YELLOW);//绘制黄线,绿色填充
setfillcolor(GREEN);
fillcircle(x,260-20*j,20); //填充
Sleep(1000);
setcolor(BLACK);
setfillcolor(BLACK);
fillcircle(x,260-20*j,20);
j++;
if(x<370)
{
int b=0;
int k=0;
for(int x=287;x>100;x-=93)
{
setcolor(YELLOW);//绘制黄线,绿色填充
setfillcolor(GREEN);
fillcircle(x,60+20*k,20); //填充
Sleep(1000);
setcolor(BLACK);
setfillcolor(BLACK);
fillcircle(x,60+20*k,20);
k++;
if(k>2)
b=1;
}
if(b=1)
break;
}
}
}
}
}
}
}
getch();
closegraph();
return 0;
}
EasyX实现圆球的反弹
最新推荐文章于 2024-02-10 11:00:31 发布