ROLLING.CPP
资源名称:C++100.rar [点击查看]
上传用户:wszmarenbt
上传日期:2013-04-26
资源大小:2552k
文件大小:1k
源码类别:
Windows编程
开发平台:
Visual C++
- /*----------------------------ANIMATION-----------------------------*/
- /* NAME:ROLLING */
- /*----------------------------ANIMATION-----------------------------*/
- #include<graphics.h>
- #include<dos.h>
- #include<conio.h>
- #include<stdio.h>
- void main()
- {
- int driver=DETECT,mode;
- int R=10,NUM=0;
- int X=10,Y=190-1;
- registerbgidriver(EGAVGA_driver);
- initgraph(&driver,&mode,""); /*INITIAL THE GRAPH*/
- line(0,200,640,200);
- do
- { /*DRAW THE CIRCLE*/
- setcolor(11);
- circle(X,Y,R);
- setfillstyle(1,11);
- floodfill(X,Y,11);
- delay(50);
- setcolor(BLACK); /*DELETE THE CIRCLE*/
- circle(X,Y,R);
- setfillstyle(1,BLACK);
- floodfill(X,Y,BLACK);
- X+=10; /*CHANGE THE POSITION OF THE CIRCLE*/
- Y=190-1;
- NUM++;
- } while(NUM<64);
- getch(); /*PRESS ANY KEY TO RETURN TO TEXT MODE*/
- closegraph();
- }