那位大侠能帮忙用c语言做个打砖块小游戏???

来源:百度知道 编辑:UC知道 时间:2024/06/23 08:56:16
急需~~~
谢谢~~~~~~~~~~~~~~~~~~~~~~~~~~

请编译前在主目录下建立一个文本文件(xia.txt)内容为:0 0 0 0 0
哈哈
#include<dos.h>
#include<stdio.h>
#include<graphics.h>
#include<math.h>
union REGS regs;
unsigned int zhuan[5];

int Msinit();
void Setmouse(int left,int right,int top,int buttom);
int Msread(int *xp,int *yp,int *bup);
void Draw(int x,int y,int sizex,int sizey);

main()
{int mode=VGAHI,driver=VGA;
unsigned int l;
int i,gi,gj,j,flag=1;/*i,j是循环变量,flag是标记变量,-1:向x负半轴移动,+1:向x正半轴移动*/
double qx,qy,k,b=0.0,speech=0.4,x,y;
double r=2.0,bx=60.0,byy=270.0;
double pianx=100.0,piany=100.0,tx=20.0,ty=10.0,jx=2.0,jy=2.0;
int mx=0,my=0,mb,sum;/*sum纪录砖块的数目*/
FILE * p;
if((p = fopen("xia.txt", "r")) == NULL)
{printf("The file cannot open!\n");
exit(1);}
initgraph(&driver,&mode,"\\tc\\BGI");
Msinit();
Setmouse((in