您当前的位置:首页资讯小游戏正文

推箱子游戏介绍,怎么玩?

放大字体  缩小字体 发布日期:2019-03-23 19:01:51 来源:惊鸿信息网 浏览次数:242
关于推箱子游戏介绍,怎么玩?内容

目录

1、那个古剑奇谭碧山女鬼推箱子到底要怎么推才能过啊
2、谁有推箱子的C语言游戏代码
3、小人推箱子图解 全15关
4、推箱子11关怎么过图解
5、手机“推箱子”第七关怎么过?
6、推箱子怎么破解?
7、c语言推箱子代码
8、推箱子攻略图
9、求啊哈c 推箱子

 

1、那个古剑奇谭碧山女鬼推箱子到底要怎么推才能过啊


1、2、3朝着箭头方向推到头就行了,不过一定要推准石头啊



2、 谁有推箱子的C语言游戏代码


#include <dos.h>
#include <stdio.h>
#include <ctype.h>
#include <conio.h>
#include <bios.h>
#include <alloc.h>

char ghouse[20][20];
char far *screen=(char far* )0xb8000000;
void putchxy(int y,int x,char ch,char fc,char bc)
{
screen[(x*160)+(y<<1)+0]=ch;
screen[(x*160)+(y<<1)+1]=(bc*16)+fc;
}
typedef struct winer {
int x,y;
struct winer *p;
}winer;
typedef struct boxs {
int x,y;
struct boxs *next;
}boxs;
void printwall(int x,int y)
{
putchxy(y-1,x-1,219,MAGENTA,BLACK);
ghouse[x][y]='w';
}
void printbox(int x,int y)
{
putchxy(y-1,x-1,10,WHITE,BLACK);
ghouse[x][y]='b';
}
void printwhither1(int x,int y,winer **win,winer **pw)
{
winer *qw;
putchxy(y-1,x-1,'*',YELLOW,BLACK);
ghouse[x][y]='m';
if(*win==NULL)
{
*win=*pw=qw=(winer* )malloc(sizeof(winer));
(*pw)->x=x;(*pw)->y=y;(*pw)->p=NULL;
}
else
{
qw=(winer* )malloc(sizeof(winer));
qw->x=x;qw->y=y;(*pw)->p=qw;(*pw)=qw;qw->p=NULL;
}
}

void printwhither(int x,int y)
{
putchxy(y-1,x-1,'*',YELLOW,BLACK);
ghouse[x][y]='m';
}

void printman(int x,int y)
{
gotoxy(y,x);
_AL=02;_CX=01;_AH=0xa;
geninterrupt(0x10);
}
void printboxin(int x,int y)
{
putchxy(y-1,x-1,10,YELLOW,BLACK);
ghouse[x][y]='i';
}
void init()
{
int i,j;

clrscr();
for(i=0;i<20;i++)
for(j=0;j<20;j++)
ghouse[i][j]=0;
_AL=3;
_AH=0;
geninterrupt(0x10);
gotoxy(40,4);
printf("Welcome to push box world!");
gotoxy(40,6);
printf("Press up,down,left,right to play.");
gotoxy(40,8);
printf("Press Esc to quit it.");
gotoxy(40,10);
printf("Press space to reset the game.");
gotoxy(40,12);
printf("April 30th 2004.");
}
winer *inithouse1()
{

int x,y;
winer *win=NULL,*pw;
gotoxy(8,2);
printf("Level No.1");
for(x=1,y=5;y<=9;y++)
printwall(x+4,y+10);
for(y=5,x=2;x<=5;x++)
printwall(x+4,y+10);
for(y=9,x=2;x<=5;x++)
printwall(x+4,y+10);
for(y=1,x=3;x<=8;x++)
printwall(x+4,y+10);
for(x=3,y=3;x<=5;x++)
printwall(x+4,y+10);
for(x=5,y=8;x<=9;x++)
printwall(x+4,y+10);
for(x=7,y=4;x<=9;x++)
printwall(x+4,y+10);
for(x=9,y=5;y<=7;y++)
printwall(x+4,y+10);
for(x=8,y=2;y<=3;y++)
printwall(x+4,y+10);
printwall(5+4,4+10);
printwall(5+4,7+10);
printwall(3+4,2+10);
printbox(3+4,6+10);
printbox(3+4,7+10);
printbox(4+4,7+10);
printwhither1(4+4,2+10,&win,&pw);
printwhither1(5+4,2+10,&win,&pw);
printwhither1(6+4,2+10,&win,&pw);
printman(2+4,8+10);
return win;
}
 

3、小人推箱子图解 全15关


小人推箱子15关过关步骤:

1、本关有六个箱子需要移动到指定位置;

2、先将上面两个箱子推下来;

3、然后将中间两个箱子也按照下图进行移动;

4、最左边的移动如下图;

5、再往左边推到底;

6、然后推成下面这个样子就行了;

7、接着往右边推,将空间留出来,然后再将中间的箱子往下面推就行了;

8、接着按照左上左的顺序推;

9、将最下面的那个箱子按照下图的样子进行移动;

10、现在还剩下最后一个箱子了,如下图所示:

11、最后一个箱子,先往左边推动两个格子的距离,然后再往下面推动,就可以将最后一个箱子推到指定地点了。

12、任务完成,小人一共走了110步。


 

4、推箱子11关怎么过图解


1、来到最下面,把最底下的箱子往右推一步。

2、来到如图的右边的箱子,将其向左推一步。

3、再来到箱子下面,将该箱子向上推一步。

4、如图将在左边的箱子一直推到最右边的靠墙壁的地方。

5、然后来到该箱子的上面,将其往下推一格。这时第一个箱子归位了。

6、来到如图所示的箱子的下面,将箱子往上推一格。

7、然后将箱子往右推一格,第二个箱子就归位了。最下面的箱子归位最简单,往右复位即可。然后就通关了。


 

5、手机“推箱子”第七关怎么过?


第七关都过不了第11关就不用过了。左上上右右上上下下左左下下右右上上上下下下右右上左下左上下左左上上上右右右下上左左左下下下右右上上右上左下左上上下下右下下右上上
 

6、推箱子怎么破解?


请从左到右分别是123号箱子,1号箱子(绿点旁的那个)从下向上推一下,绕到它的右边向左推,在从上往下推至绿点。
3号箱子(最右),往左推2格,然后推2号箱子往左一格,绕一下把3号往右推一格,从下向上推至最上方的红点,2号向上一格,右一格,上一格。


 

7、c语言推箱子代码


Here you are!
编译通过。

#include <dos.h>
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <conio.h>
#include <bios.h>
#include <alloc.h>

char ghouse[20][20];


char far *screen=(char far* )0xb8000000;
void putchxy(int y,int x,char ch,char fc,char bc)
{
screen[(x*160)+(y<<1)+0]=ch;
screen[(x*160)+(y<<1)+1]=(bc*16)+fc;
}


typedef struct winer {
int x,y;
struct winer *p;
}winer;


typedef struct boxs {
int x,y;
struct boxs *next;
}boxs;


void printwall(int x,int y)
{
putchxy(y-1,x-1,219,MAGENTA,BLACK);
ghouse[x][y]='w';
}


void printbox(int x,int y)
{
putchxy(y-1,x-1,10,WHITE,BLACK);
ghouse[x][y]='b';
}


void printwhither1(int x,int y,winer **win,winer **pw)
{
winer *qw;
putchxy(y-1,x-1,'*',YELLOW,BLACK);
ghouse[x][y]='m';
if(*win==NULL)
{
*win=*pw=qw=(winer* )malloc(sizeof(winer));
(*pw)->x=x;(*pw)->y=y;(*pw)->p=NULL;
}
else
{
qw=(winer* )malloc(sizeof(winer));
qw->x=x;qw->y=y;(*pw)->p=qw;(*pw)=qw;qw->p=NULL;
}
}


void printwhither(int x,int y)
{
putchxy(y-1,x-1,'*',YELLOW,BLACK);
ghouse[x][y]='m';
}

void printman(int x,int y)
{
gotoxy(y,x);
_AL=02;_CX=01;_AH=0xa;
geninterrupt(0x10);
}


void printboxin(int x,int y)
{
putchxy(y-1,x-1,10,YELLOW,BLACK);
ghouse[x][y]='i';
}


void init()
{
int i,j;
system("cls");
for(i=0;i<20;i++)
for(j=0;j<20;j++)
ghouse[i][j]=0;
_AL=3;
_AH=0;
geninterrupt(0x10);
gotoxy(40,4);
printf("Welcome to push box world!");
gotoxy(40,6);
printf("Press up,down,left,right to play.");
gotoxy(40,8);
printf("Press Esc to quit it.");
gotoxy(40,10);
printf("Press space to reset the game.");
gotoxy(40,12);
printf("April 30th 2004.");
}


winer *inithouse1()
{
int x,y;
winer *win=NULL,*pw;
gotoxy(8,2);
printf("Level No.1");
for(x=1,y=5;y<=9;y++)
printwall(x+4,y+10);
for(y=5,x=2;x<=5;x++)
printwall(x+4,y+10);
for(y=9,x=2;x<=5;x++)
printwall(x+4,y+10);
for(y=1,x=3;x<=8;x++)
printwall(x+4,y+10);
for(x=3,y=3;x<=5;x++)
printwall(x+4,y+10);
for(x=5,y=8;x<=9;x++)
printwall(x+4,y+10);
for(x=7,y=4;x<=9;x++)
printwall(x+4,y+10);
for(x=9,y=5;y<=7;y++)
printwall(x+4,y+10);
for(x=8,y=2;y<=3;y++)
printwall(x+4,y+10);
printwall(5+4,4+10);
printwall(5+4,7+10);
printwall(3+4,2+10);
printbox(3+4,6+10);
printbox(3+4,7+10);
printbox(4+4,7+10);
printwhither1(4+4,2+10,&win,&pw);
printwhither1(5+4,2+10,&win,&pw);
printwhither1(6+4,2+10,&win,&pw);
printman(2+4,8+10);
return win;
}


winer *inithouse3()
{int x,y;
winer *win=NULL,*pw;
gotoxy(8,3);
printf("Level No.3");
for(x=1,y=2;y<=8;y++)
printwall(x+4,y+10);
for(x=2,y=2;x<=4;x++)
printwall(x+4,y+10);
for(x=4,y=1;y<=3;y++)
printwall(x+4,y+10);
for(x=5,y=1;x<=8;x++)
printwall(x+4,y+10);
for(x=8,y=2;y<=5;y++)
printwall(x+4,y+10);
for(x=5,y=5;x<=7;x++)
printwall(x+4,y+10);
for(x=7,y=6;y<=9;y++)
printwall(x+4,y+10);
for(x=3,y=9;x<=6;x++)
printwall(x+4,y+10);
for(x=3,y=6;y<=8;y++)
printwall(x+4,y+10);
printwall(2+4,8+10);
printwall(5+4,7+10);
printbox(6+4,3+10);
printbox(4+4,4+10);
printbox(5+4,6+10);
printwhither1(2+4,5+10,&win,&pw);
printwhither1(2+4,6+10,&win,&pw);
printwhither1(2+4,7+10,&win,&pw);
printman(2+4,4+10);
return win;
}


winer *inithouse2()
{int x,y;
winer *win=NULL,*pw;
gotoxy(8,2);
printf("Level No.2");
for(x=1,y=4;y<=7;y++)
printwall(x+4,y+10);
for(x=2,y=2;y<=4;y++)
printwall(x+4,y+10);
for(x=2,y=7;x<=4;x++)
printwall(x+4,y+10);
for(x=4,y=1;x<=8;x++)
printwall(x+4,y+10);
for(x=8,y=2;y<=8;y++)
printwall(x+4,y+10);
for(x=4,y=8;x<=8;x++)
printwall(x+4,y+10);
for(x=4,y=6;x<=5;x++)
printwall(x+4,y+10);
for(x=3,y=2;x<=4;x++)
printwall(x+4,y+10);
for(x=4,y=4;x<=5;x++)
printwall(x+4,y+10);
printwall(6+4,3+10);
printbox(3+4,5+10);
printbox(6+4,6+10);
printbox(7+4,3+10);
printwhither1(5+4,7+10,&win,&pw);
printwhither1(6+4,7+10,&win,&pw);
printwhither1(7+4,7+10,&win,&pw);
printman(2+4,6+10);
return win;
}


winer *inithouse4()
{int x,y;
winer *win=NULL,*pw;
gotoxy(8,2);
printf("Level No.4");
for(x=1,y=1;y<=6;y++)
printwall(x+4,y+10);
for(x=2,y=7;y<=8;y++)
printwall(x+4,y+10);
for(x=2,y=1;x<=7;x++)
printwall(x+4,y+10);
for(x=7,y=2;y<=4;y++)
printwall(x+4,y+10);
for(x=6,y=4;y<=9;y++)
printwall(x+4,y+10);
for(x=3,y=9;x<=5;x++)
printwall(x+4,y+10);
for(x=3,y=3;y<=4;y++)
printwall(x+4,y+10);
printwall(3+4,8+10);
printbox(3+4,5+10);
printbox(4+4,4+10);
printbox(4+4,6+10);
printbox(5+4,5+10);
printbox(5+4,3+10);
printwhither1(3+4,7+10,&win,&pw);
printwhither1(4+4,7+10,&win,&pw);
printwhither1(5+4,7+10,&win,&pw);
printwhither1(4+4,8+10,&win,&pw);
printwhither1(5+4,8+10,&win,&pw);
printman(2+4,2+10);
return win;
}


movebox(int x,int y,char a)
{switch(a)
{
case 'u':ghouse[x-1][y]=0;printf(" ");
printbox(x-2,y);printman(x-1,y);
ghouse[x-2][y]='b';break;
case 'd':ghouse[x+1][y]=0;printf(" ");
printbox(x+2,y);printman(x+1,y);
ghouse[x+2][y]='b';break;
case 'l':ghouse[x][y-1]=0;printf(" ");
printbox(x,y-2);printman(x,y-1);
ghouse[x][y-2]='b';break;
case 'r':ghouse[x][y+1]=0;printf(" ");
printbox(x,y+2);printman(x,y+1);
ghouse[x][y+2]='b';break;
default: break;
}
}


moveinbox(int x,int y,char a)
{switch(a)
{
case 'u':ghouse[x-1][y]='m';printf(" ");
printbox(x-2,y);printman(x-1,y);
ghouse[x-2][y]='b';break;
case 'd':ghouse[x+1][y]='m';printf(" ");
printbox(x+2,y);printman(x+1,y);
ghouse[x+2][y]='b';break;
case 'l':ghouse[x][y-1]='m';printf(" ");
printbox(x,y-2);printman(x,y-1);
ghouse[x][y-2]='b';break;
case 'r':ghouse[x][y+1]='m';printf(" ");
printbox(x,y+2);printman(x,y+1);
ghouse[x][y+2]='b';break;
default: break;
}
}


moveboxin(int x,int y,char a)
{switch(a)
{
case 'u':ghouse[x-1][y]=0;printf(" ");
printboxin(x-2,y);printman(x-1,y);
ghouse[x-2][y]='i';break;
case 'd':ghouse[x+1][y]=0;printf(" ");
printboxin(x+2,y);printman(x+1,y);
ghouse[x+2][y]='i';break;
case 'l':ghouse[x][y-1]=0;printf(" ");
printboxin(x,y-2);printman(x,y-1);
ghouse[x][y-2]='i';break;
case 'r':ghouse[x][y+1]=0;printf(" ");
printboxin(x,y+2);printman(x,y+1);
ghouse[x][y+2]='i';break;
default: break;
}
}


moveinboxin(int x,int y,char a)
{switch(a)
{
case 'u':ghouse[x-1][y]='m';printf(" ");
printboxin(x-2,y);printman(x-1,y);
ghouse[x-2][y]='i';break;
case 'd':ghouse[x+1][y]='m';printf(" ");
printboxin(x+2,y);printman(x+1,y);
ghouse[x+2][y]='i';break;
case 'l':ghouse[x][y-1]='m';printf(" ");
printboxin(x,y-2);printman(x,y-1);
ghouse[x][y-2]='i';break;
case 'r':ghouse[x][y+1]='m';printf(" ");
printboxin(x,y+2);printman(x,y+1);
ghouse[x][y+2]='i';break;
default: break;
}
}


int judge(int x,int y)
{int i;
switch(ghouse[x][y])
{
case 0: i=1;break;
case 'w': i=0;break;
case 'b': i=2;break;
case 'i': i=4;break;
case 'm': i=3;break;
default: break;
}
return i;
}


move(int x,int y,char a)
{switch(a)
{
case 'u':if(!judge(x-1,y)) {gotoxy(y,x);break;}
else if(judge(x-1,y)==1||judge(x-1,y)==3)
{if(judge(x,y)==3)
{ printwhither(x,y);printman(x-1,y);break;}
else
{printf(" ");printman(x-1,y);break;}
}
else if(judge(x-1,y)==2)
{ if(judge(x-2,y)==1)
{movebox(x,y,'u');
if(judge(x,y)==3) printwhither(x,y); gotoxy(y,x-1);
}
else if(judge(x-2,y)==3)
{ moveboxin(x,y,'u');
if(judge(x,y)==3) printwhither(x,y); gotoxy(y,x-1);
}
else gotoxy(y,x);
break;
}
else if(judge(x-1,y)==4)
{ if(judge(x-2,y)==1)
{moveinbox(x,y,'u');
if(judge(x,y)==3) printwhither(x,y);gotoxy(y,x-1);
}
else if(judge(x-2,y)==3)
{ moveinboxin(x,y,'u');
if(judge(x,y)==3) printwhither(x,y);gotoxy(y,x-1);
}
else gotoxy(y,x);
break;
}
case 'd':if(!judge(x+1,y)) {gotoxy(y,x);break;}
else if(judge(x+1,y)==1||judge(x+1,y)==3)
{if(judge(x,y)==3)
{ printwhither(x,y);printman(x+1,y);break;}
else
{printf(" ");printman(x+1,y);break;}
}
else if(judge(x+1,y)==2)
{ if(judge(x+2,y)==1)
{movebox(x,y,'d');
if(judge(x,y)==3) printwhither(x,y);gotoxy(y,x+1);
}
else if(judge(x+2,y)==3)
{moveboxin(x,y,'d');
if(judge(x,y)==3) printwhither(x,y);gotoxy(y,x+1);
}
else gotoxy(y,x);
break;
}
else if(judge(x+1,y)==4)
{ if(judge(x+2,y)==1)
{moveinbox(x,y,'d');
if(judge(x,y)==3) printwhither(x,y);gotoxy(y,x+1);
}
else if(judge(x+2,y)==3)
{moveinboxin(x,y,'d');
if(judge(x,y)==3) printwhither(x,y);gotoxy(y,x+1);
}
else gotoxy(y,x);
break;
}

case 'l':if(!judge(x,y-1)) {gotoxy(y,x);break;}
else if(judge(x,y-1)==1||judge(x,y-1)==3)
{if(judge(x,y)==3)
{ printwhither(x,y);printman(x,y-1);break;}
else
{printf(" ");printman(x,y-1);break;}
}
else if(judge(x,y-1)==2)
{ if(judge(x,y-2)==1)
{movebox(x,y,'l');
if(judge(x,y)==3) printwhither(x,y); gotoxy(y-1,x);
}
else if(judge(x,y-2)==3)
{moveboxin(x,y,'l');
if(judge(x,y)==3) printwhither(x,y); gotoxy(y-1,x);
}
else gotoxy(y,x);
break;
}
else if(judge(x,y-1)==4)
{ if(judge(x,y-2)==1)
{moveinbox(x,y,'l');
if(judge(x,y)==3) printwhither(x,y); gotoxy(y-1,x);
}
else if(judge(x,y-2)==3)
{moveinboxin(x,y,'l');
if(judge(x,y)==3) printwhither(x,y); gotoxy(y-1,x);
}
else gotoxy(y,x);
break;
}
case 'r':if(!judge(x,y+1)) {gotoxy(y,x);break;}
else if(judge(x,y+1)==1||judge(x,y+1)==3)
{if(judge(x,y)==3)
{printwhither(x,y);printman(x,y+1);break;}
else
{printf(" ");printman(x,y+1);break;}
}
else if(judge(x,y+1)==2)
{ if(judge(x,y+2)==1)
{movebox(x,y,'r');
if(judge(x,y)==3) printwhither(x,y); gotoxy(y+1,x);
}
else if(judge(x,y+2)==3)
{moveboxin(x,y,'r');
if(judge(x,y)==3) printwhither(x,y); gotoxy(y+1,x);
}
else gotoxy(y,x);
break;
}
else if(judge(x,y+1)==4)
{ if(judge(x,y+2)==1)
{moveinbox(x,y,'r');
if(judge(x,y)==3) printwhither(x,y); gotoxy(y+1,x);
}
else if(judge(x,y+2)==3)
{moveinboxin(x,y,'r');
if(judge(x,y)==3) printwhither(x,y); gotoxy(y+1,x);
}
else gotoxy(y,x);
break;
}
default: break;
}
}


void reset(int i)
{switch(i)
{
case 0: init();
inithouse1();break;
case 1: init();
inithouse2();break;
case 2: init();
inithouse3();break;
case 3: init();
inithouse4();break;
default:break;
}
}


main()
{int key,x,y,s,i=0;
winer *win,*pw;
_AL=3;_AH=0;
geninterrupt(0x10);
init();
win=inithouse1();
do{
_AH=3;
geninterrupt(0x10);
x=_DH+1;y=_DL+1;
while(bioskey(1)==0);
key=bioskey(0);
switch(key)
{
case 0x4800:move(x,y,'u');break;
case 0x5000:move(x,y,'d');break;
case 0x4b00:move(x,y,'l');break;
case 0x4d00:move(x,y,'r');break;
case 0x3920:reset(i);break;
default:break;
}
s=0;
pw=win;
while(pw)
{
if(ghouse[pw->x][pw->y]=='m') s++;
pw=pw->p;
}
if(s==0)
{
free(win);
gotoxy(25,2);
printf("Congratulate! You have passed Level %d!",i+1);
getch();
i++;
switch(i)
{
case 1: init();
win=inithouse2();break;
case 2: init();
win=inithouse3();break;
case 3: init();
win=inithouse4();break;
case 4: gotoxy(8,14);
printf("Great! You have passed all the levels! Press any key to quit!");
key=0x011b;getch();break;
default: break;
}
}
}while(key!=0x011b);
_AL=3;
_AH=0;
geninterrupt(0x10);
}
 

8、推箱子攻略图


1.最上面的那个箱子推向左边一格,人下来,
2.把嘴右面的那个箱子往上推,与第一个箱子平行,
3.把现在最下面的那个箱子往左推碰墙
4.把中间的那个箱子往上推,与另两个平行,人上去
5.把上排中间的那个箱子往下推,与下面的那个平行
6.人到最左边把第一步推的那个箱子,推到上一步推开的那个箱子的位置,现在的图面应该是上面的那个箱子挨在一起,靠中的那个在位置上;下面的也是两个箱子挨在一起,靠中的那个箱子的位置上。
7.人下来,把下面两个箱子的左边的那个往上推一格,人绕到中间位置
8.把上一步推上来的箱子往左边推一格,人出来,绕到箱子后边,再把箱子推回位置
9.最后一步,到上面把右边的一个箱子往下推一格。
 

9、求啊哈c 推箱子


我的可能可以帮到你
int main()
{
printf("现在玩一个新游戏,叫推箱子。");
system("pause");
system("cls");
printf("如果玩不过,或觉得太简单,请按t键跳过。。\n");
system("pause");
system("cls");
char a[50][50] = {
" ### ",
" #*# ",
" # # ",
"####0######",
"#* 0S 0 *#",
"#####0#####",
" # # ",
" #*# ",
" ### ",
};
int i, x, y, p, q;
char ch;
x = 4; y = 5; p = 1; q = 5;
while (1)
{
//打印图像
for (i = 0; i < 10; i++)
{
puts(a[i]);
}
ch = _getch();//扫描键盘
//向下走。
if (ch == 's' || ch == 'S')
{
if (a[x + 1][y] == '#')//判断是否碰到墙
{
}
else if (a[x + 1][y] == '0')//判断是否碰到箱子
{
if (a[x + 2][y] == ' ')//判断箱子后面是不是空的
{
a[x][y] = ' ';
x++;
a[x][y] = 'S';
a[x + 1][y] = '0';
}
else if (a[x + 2][y] == '*')//箱子后面是否是*
{
a[x][y] = ' ';
x++;
a[x][y] = 'S';
a[x + 1][y] = '@';
}
}
else if (a[x + 1][y] == ' ')//判断前面是不是空的
{
a[x][y] = ' ';
x++;
a[x][y] = 'S';
}
}
if (ch == 'w' || ch == 'W')
{
if (a[x - 1][y] == '#')//判断是否碰到墙
{
}
else if (a[x - 1][y] == '0')//判断是否碰到箱子
{
if (a[x - 2][y] == ' ')//判断箱子后面是不是空的
{
a[x][y] = ' ';
x--;
a[x][y] = 'S';
a[x - 1][y] = '0';
}
else if (a[x - 2][y] == '*')//箱子后面是否是*
{
a[x][y] = ' ';
x--;
a[x][y] = 'S';
a[x - 1][y] = '@';
}
}
else if (a[x - 1][y] == ' ')//判断前面是不是空的
{
a[x][y] = ' ';
x--;
a[x][y] = 'S';
}
}
if (ch == 'd' || ch == 'D')
{
if (a[x][y + 1] == '#')//判断是否碰到墙
{
}
else if (a[x][y + 1] == '0')//判断是否碰到箱子
{
if (a[x][y + 2] == ' ')//判断箱子后面是不是空的
{
a[x][y] = ' ';
y++;
a[x][y] = 'S';
a[x][y + 1] = '0';
}
else if (a[x][y + 2] == '*')//箱子后面是否是*
{
a[x][y] = ' ';
y++;
a[x][y] = 'S';
a[x][y + 1] = '@';
}
}
else if (a[x][y + 1] == ' ')//判断前面是不是空的
{
a[x][y] = ' ';
y++;
a[x][y] = 'S';
}
}
if (ch == 'a' || ch == 'A')
{
if (a[x][y - 1] == '#')//判断是否碰到墙
{
}
else if (a[x][y - 1] == '0')//判断是否碰到箱子
{
if (a[x][y - 2] == ' ')//判断箱子后面是不是空的
{
a[x][y] = ' ';
y--;
a[x][y] = 'S';
a[x][y - 1] = '0';
}
else if (a[x][y - 2] == '*')//箱子后面是否是*
{
a[x][y] = ' ';
y--;
a[x][y] = 'S';
a[x][y - 1] = '@';
}
}
else if (a[x][y - 1] == ' ')//判断前面是不是空的
{
a[x][y] = ' ';
y--;
a[x][y] = 'S';
}
}
if (ch == 't' || ch == 'T')
{
break;
}
system("cls");
if (a[4][1] == '@'&&a[1][4] == '@'&&a[7][5] == '@'&&a[4][9] == '@')
{
printf("恭喜你过关了!!!!\n");
system("pause");
system("cls");
break;
}
}
system("cls");
}

关键词:

“如果发现本网站发布的资讯影响到您的版权,可以联系本站!同时欢迎来本站投稿!