|
本帖最后由 848888888488888 于 2010-5-16 13:07 编辑
- bool screen[100][64]; //屏幕数组
- struct TheBall
- {
- int x;
- int y; //坐标
- bool UP;
- bool DOWN;
- bool RIGHT;
- bool LEFT;
- int speedx;
- int speedy;
- };
- TheBall ball;
- struct TheBlock
- {
- int x;
- int y;
- int height;
- int width;
- };
- TheBlock basicblock;
- inline void control()
- {
- if (ButtonPressed(BTN4, true)&&ball.DOWN&&ball.UP==0)
- {
- ball.speedy=10;
- ball.DOWN=0;
- }
- if (ButtonPressed(BTN3, true)&&ball.LEFT==0)ball.speedx=-3;
- if (ButtonPressed(BTN2, true)&&ball.RIGHT==0)ball.speedx=3;
- }
- inline void setbasicblock()
- {
- basicblock.height=3;
- basicblock.width=3;
- }
- void block(int x,int y,int num)
- { int i;
- setbasicblock();
- for (i=0;i<=num;i++)
- {
- RectOut(x,y,basicblock.width,basicblock.height);
- x+=basicblock.width;
- }
- for (i=x;i<=x+3*i;i++) screen[i][y]=1; screen[i][y-3]=1;
- for (i=y;i<=y-3;i--) screen[x][i]=1;screen[x+3*num][i]=1;
- }
- void LineOutEx(int x,int y,int lg,string type)
- { int i,i1;
- if (type=="vertical")
- {
- for (i=y;i<=lg+y;i++) screen[x][i]=1;
- LineOut(x,y,x,y+lg);
- }
- if (type=="horizontal")
- {
- for (i=x;i<=lg+x;i++) screen[i][y]=1;
- LineOut(x,y,x+lg,y);
- }
- }
- void pipe(int x,int y)
- {
- block(x-3,y+9,4);
- block(x,y+6,2);
- block(x,y+3,2);
- }
- inline void freezeball()
- {
- while (ball.DOWN&&ball.speedx==0&&ball.speedy==0)
- {
- control();
- }
- }
- inline void display()
- {
- // RectOut(basicblock.x,basicblock.y,basicblock.width,basicblock.height,0);
- CircleOut(ball.x,ball.y+4,3);
- CircleOut(ball.x,ball.y+4,3,0x0004);
- }
- inline void run()
- {
- if (ball.DOWN) ball.speedy=0;
- else ball.speedy--;
- ball.x+=ball.speedx;
- ball.x+=ball.speedy;
- }
- task main()
- {
- }
复制代码 在BCC里面它报错的代码(全部复制过来了):
具体的错误是(没有哪一行……):
Error:Preprocessor marco function does not match instance(#_x1,_y1,_x2,_y2,_options#acquire__LineOutMutex
恩,应该没有打漏了;
我用过几个版本的BCC,都有报错,有哪位大侠能告诉我是什么问题? |
|