看我不动也会张的大嘴巴!
#include <bios.h>
#include <math.h>
#include <graphics.h>
#include <stdio.h>
#include <time.h>
#include <dos.h>
#define r 15
#define c(c) setfillstyle(1,c)
main()
{int x,y;float j;double i;char k='d';
char c;
int gdriver=DETECT,gmode;
initgraph(&gdriver,&gmode,"c:\\tc2\\bgi");/******路径**********/
x=320;
y=240;
setcolor(0);
ground();
printf("press w,a,s,d to move");
i=getch();
i=0;
printf("\n");
while(k!='q')
{while(bioskey(1)==0)
{c(YELLOW);fillellipse(x,y,r,r);
j=45*sin(i)*sin(i);
c(0);
switch(k)
{case 'a': pieslice(x,y,180-j,180+j,r);break;
case 'd': pieslice(x,y,0,0+j,r);pieslice(x,y,360-j,360,r);break;
case 's': pieslice(x,y,270-j,270+j,r);break;
case 'w': pieslice(x,y,90-j,90+j,r);break;
}
delay(10000);
c(0);bar(x-r,y-r,x+r,y+r);
i+=0.3;
}
k=bioskey(0);
switch(k)
{case 'a':x-=3;break;
case 'd':x+=3;break;
case 's':y+=3;break;
case 'w':y-=3;break;
}
}
}
ground()
{int i,rx,ry;
for(i=1;i<=20000;i++)
putpixel(rand()%640,rand()%480,2);
for(i=1;i<=1000;i++)
{rx=rand()%640;ry=rand()%480;
putpixel(rx,ry,12);
putpixel(rx+1,ry,12);
putpixel(rx+1,ry+1,12);}
for(i=1;i<=20000;i++)
putpixel(rand()%640,rand()%480,10);
return;
}
Word教程网 | Excel教程网 | Dreamweaver教程网 | Fireworks教程网 | PPT教程网 | FLASH教程网 | PS教程网 |
HTML教程网 | DIV CSS教程网 | FLASH AS教程网 | ACCESS教程网 | SQL SERVER教程网 | C语言教程网 | JAVASCRIPT教程网 |
ASP教程网 | ASP.NET教程网 | CorelDraw教程网 |