绘制动画(2)
1 //实现一个圆从左往右跳动 2 #include<graphics.h> 3 #include<conio.h> 4 int main() 5 { 6 initgraph(640,480); 7 for(int x=0;x<=540;x+=20) 8 {//绘制黄线 绿色填充的圆 9 setcolor(YELLOW); 10 setfillcolor(GREEN); 11 fillcircle(x,100,20); 12 Sleep(500);//延时 13 setcolor(BLACK);//绘制黑线 黑色填充的圆 14 setfillcolor(BLACK); 15 fillcircle(x,100,20); 16 } 17 getch(); 18 closegraph(); 19 }