向各位求救了!我的问题就是:运动的小圆在运动后怎么把前面的小圆擦除掉?有什么函数吗?谢谢了!
程序如下:
#include<graphics.h>
#include<stdio.h>
#include<dos.h>
main()
{
int gdriver=DETECT,gmode,y=180,i;
initgraph(&gdriver,&gmode,""); /*初始化图形系统*/
cleardevice();
rect();/*调用画图函数*/
for(i=0;i<5;i++) /*点(120,180)到点(120,120)的数据发送*/
{
setcolor(RED);
outtextxy(90,100,"line is free,send message!");
circle(120,y,2);
sleep(1);
y=y-14;
y--;
}
getch();
closegraph();
}
rect()
{
setbkcolor(GREEN); /*背景颜色*/
setlinestyle(SOLID_LINE,3,3);/*设定线的类型*/
line(90,120,510,120); /*画直线*/
line(120,120,120,180);
line(240,120,240,180);
line(360,120,360,180);
line(480,120,480,180);
setcolor(YELLOW);
setfillstyle(SOLID_FILL,LIGHTGRAY); /*填充矩形颜色*/
bar(90,180,150,240); /*画巨型框*/
bar(210,180,270,240);
bar(330,180,390,240);
bar(450,180,510,240);
outtextxy(95,210,"site 1"); /*在矩形框内标明站点序号*/
outtextxy(215,210,"site 2");
outtextxy(335,210,"site 3");
outtextxy(455,210,"site 4");
}