|
|
|
@ -128,3 +128,54 @@ void right()
|
|
|
|
|
printf("¡ô");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
void left()
|
|
|
|
|
{
|
|
|
|
|
if(map[x][y-1]==3) flag=2;
|
|
|
|
|
if(map[x][y-1]==1){
|
|
|
|
|
xy(x,y);
|
|
|
|
|
printf(" ");
|
|
|
|
|
map[x][y-1]=4;
|
|
|
|
|
map[x][y]=1;
|
|
|
|
|
y--;
|
|
|
|
|
coord.X-=2; xy();
|
|
|
|
|
printf("◆");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
/*主菜单*/
|
|
|
|
|
void mune()
|
|
|
|
|
{
|
|
|
|
|
system("color F6");
|
|
|
|
|
system("mode con cols=50 lines=15");
|
|
|
|
|
x=1;y=1; flag=0;
|
|
|
|
|
system("cls");
|
|
|
|
|
printf("\n\n\n 迷宫游戏\n\n");
|
|
|
|
|
printf(" 主菜单\n");
|
|
|
|
|
printf(" 1:更改难度 {难度等级:1(默认)/2/3}\n");
|
|
|
|
|
printf(" 2:开始游戏\n");
|
|
|
|
|
printf(" 3:退出游戏\n");
|
|
|
|
|
printf(" 0:退回菜单\n");
|
|
|
|
|
printf("\nTips:\n请使用英文(半角)输入 游戏中回到菜单会断档\n请用WASD控制移动 ◆:玩家 ◎:终点") ;
|
|
|
|
|
while(1){
|
|
|
|
|
switch(getch())
|
|
|
|
|
{
|
|
|
|
|
case '3': flag=3;break;
|
|
|
|
|
case '2': CreateMaze();flag=1;break;
|
|
|
|
|
default: break;
|
|
|
|
|
case '1':{
|
|
|
|
|
coord.X = 0;
|
|
|
|
|
coord.Y = 14;
|
|
|
|
|
xy();printf(" ");
|
|
|
|
|
xy();
|
|
|
|
|
printf("请输入难度:");
|
|
|
|
|
switch(getch()){
|
|
|
|
|
case '1':n=21; m=21;printf("难度等级1修改成功!");break;
|
|
|
|
|
case '2':n=31; m=31;printf("难度等级2修改成功!");break;
|
|
|
|
|
case '3':n=41; m=41;printf("难度等级3修改成功!");break; //...
|
|
|
|
|
default: printf("输入错误,修改失败!");
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if(flag==1||flag==2||flag==3) break;
|
|
|
|
|
}
|
|
|
|
|
}
|