玩法:
wasd控制红球移动
ijkl控制蓝球移动
()[]传送门
蓝球到Π旁时按o键可以做任务
箭头可以上楼
**是放射性物质蓝要小心它
蓝的任务是做完100%的任务
红的任务是抓到蓝
建议双人游玩
献上代码 (。•ˇ‸ˇ•。)请勿白嫖
#include<bits/stdc++.h>
#include<windows.h>
#include"conio.h"
using namespace std;
long long l_x=18,l_y=18,h_x=1,h_y=1,h_dd=2,l_dd=5;
double r_w_j_d=0;
bool h_s_f_s_l=false,l_s_f_s_l=false,js=false;
char n;
string d_t="无";
int y_x_a[20][20],y_x_d_t[20][20],s_m_a[20][20]={
{1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},
{1,2,5,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,1},
{1,5,5,1,1,0,0,0,0,0,0,0,0,0,13,0,0,0,0,1},
{1,4,13,4,0,0,1,0,1,0,4,4,4,0,1,1,0,0,4,1},
{1,15,4,4,10,0,17,0,1,0,0,0,0,0,0,0,0,1,12,1},
{1,0,4,4,0,0,0,0,0,0,1,0,1,0,0,1,0,1,0,1},
{1,7,0,0,0,0,20,0,1,1,1,0,20,1,1,1,0,1,0,1},
{1,0,0,0,11,0,0,0,1,0,0,0,0,0,0,12,0,1,0,1},
{1,0,1,0,0,6,0,0,1,18,0,0,9,1,1,0,0,12,1,1},
{1,0,0,0,7,0,9,0,0,0,1,14,1,0,0,0,0,0,6,1},
{1,0,1,1,1,1,1,6,0,1,4,0,1,14,0,0,0,0,0,1},
{1,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,1,0,0,1},
{1,0,1,0,0,0,0,1,0,1,0,0,0,11,0,16,0,0,9,1},
{1,0,1,0,6,0,0,0,0,0,19,0,6,0,0,0,1,0,0,1},
{1,0,1,6,0,4,0,1,0,1,0,0,0,4,0,0,1,1,14,1},
{1,0,0,0,0,0,0,0,0,1,0,0,4,4,0,0,0,0,0,1},
{1,0,0,4,0,0,0,0,0,1,0,1,1,10,0,0,0,0,0,1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4,0,0,1,0,0,1,1},
{1,0,0,0,1,0,0,4,4,0,0,0,4,0,0,0,0,0,11,1},
{1,0,13,0,0,0,4,4,1,0,0,4,0,0,13,0,6,0,1,1},
{1,0,4,0,0,0,0,13,0,0,6,0,1,0,1,0,6,0,11,1},
{1,0,1,0,1,0,6,1,0,0,0,0,0,0,4,0,6,0,1,1},
{1,0,1,0,0,0,0,1,13,0,13,0,0,0,4,0,6,0,11,1},
{1,0,4,0,0,6,6,4,1,4,1,0,0,0,4,0,6,0,1,1},
{1,0,12,0,0,0,0,6,4,0,0,0,0,0,4,0,6,0,11,1},
{1,0,0,0,0,0,0,0,1,6,0,0,0,0,1,4,0,0,1,1},
{1,0,0,1,0,1,1,0,12,0,0,6,0,1,15,1,0,0,11,1},
{1,0,0,1,0,0,1,0,1,0,0,0,0,0,0,0,0,0,1,1},
{1,0,1,1,0,0,0,0,4,4,0,0,1,1,0,1,0,0,0,1},
{1,0,0,0,0,0,1,0,4,4,0,6,0,0,0,0,0,1,0,1},
{1,0,6,0,0,1,1,0,0,0,0,0,0,6,0,0,0,5,5,1},
{1,0,0,0,0,0,0,0,1,11,1,11,1,11,1,11,1,5,0,1},
{1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},
};
void s_c(char *m)
{
while(1)
{
if(*m!=0)
printf("%c",*m++);
else
break;
Sleep(100);
}
cout<<endl;
}
void y_x_c_s_h()
{
r_w_j_d=0,l_x=18,l_y=18,h_x=1,h_y=1,h_dd=2,l_dd=5,h_s_f_s_l=false,l_s_f_s_l=false,js=false;
for(int i=0;i<=19;i++)
for(int y=0;y<=19;y++)
s_m_a[i][y]=s_m_d_t[i][y];
s_m_a[1][1]=2;
s_m_a[18][18]=3;
for(int i=0;i<=19;i++)
for(int y=0;y<=19;y++)
h_g_c_a[i][y]=h_g_c_d_t[i][y];
h_g_c_a[1][1]=2;
h_g_c_a[18][18]=3;
}
void color(int x)
{
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), x);
}
void j_b()
{
system("cls");
color(2);
cout<<"蓝方惊变 红方获胜"<<endl;
cout<<"蓝方进度:"<<r_w_j_d<<"%"<<endl;
js=true;
}
void h_sl()
{
system("cls");
color(4);
cout<<"红方获胜"<<endl;
cout<<"蓝方进度:"<<r_w_j_d<<"%"<<endl;
js=true;
}
void l_sl()
{
system("cls");
color(9);
cout<<"蓝方获胜"<<endl;
if(s_m_a[l_y-1][l_x-1]==2||s_m_a[l_y][l_x-1]==2||s_m_a[l_y+1][l_x-1]==2||s_m_a[l_y-1][l_x]==2||s_m_a[l_y+1][l_x-1]==2||s_m_a[l_y-1][l_x+1]==2||s_m_a[l_y][l_x+1]==2||s_m_a[l_y+1][l_x+1]==2)
cout<<"差一丢丢就抓到了"<<endl;
js=true;
}
void sq()
{
HANDLE handle = GetStdHandle(STD_OUTPUT_HANDLE);
CONSOLE_CURSOR_INFO CursorInfo;
GetConsoleCursorInfo(handle, &CursorInfo);
CursorInfo.bVisible = false;
SetConsoleCursorInfo(handle, &CursorInfo);
}
void f_c_m()
{
system("cls");
cout<<"\n\n\n\n\n\n\n\n";
cout<<" 健康游戏忠告"<<endl<<endl;
cout<<" 抵制不良游戏,拒绝盗版游戏。"<<endl;
cout<<" 注意自我保护,谨防受骗上当。"<<endl;
cout<<" 适宜游戏易脑,沉迷游戏伤身。"<<endl;
cout<<" 合理安排时间,享受健康生活。"<<endl;
Sleep(5000);
}
void game()
{
for(;;)
{
system("cls");
for(int i=0;i<=19;i++)
{
for(int y=0;y<=19;y++)
{
if(d_t=="沙漠")
{
if(y_x_a[i][y]==2)
{
if(h_s_f_s_l==false)
color(228);
else
{
if(y_x_d_t[i][y]==4)
color(116);
else if(y_x_d_t[i][y]==1)
color(100);
}
cout<<"●";
}
else if(y_x_a[i][y]==1)
{
color(102);
cout<<"■";
}
else if(y_x_a[i][y]==3)
{
if(l_s_f_s_l==false)
color(225);
else{
if(y_x_d_t[i][y]==4)
color(113);
else if(y_x_d_t[i][y]==1)
color(97);
}
cout<<"●";
}
else if(y_x_a[i][y]==4)
{
color(120);
cout<<"×";
}else if(y_x_a[i][y]==5)
{
color(231);
cout<<"○";
}else if(y_x_a[i][y]==6)
{
color(234);
cout<<"**";
}else if(y_x_a[i][y]==7)
{
color(230);
cout<<"◣";
}else if(y_x_a[i][y]==9)
{
color(230);
cout<<"◢";
}else if(y_x_a[i][y]==20)
{
color(230);
cout<<"◥";
}else if(y_x_a[i][y]==10)
{
color(230);
cout<<"◤";
}else if(y_x_a[i][y]==11)
{
color(999);
cout<<"Π";
}else if(y_x_a[i][y]==12)
{
color(999);
cout<<"↑";
}else if(y_x_a[i][y]==13)
{
color(999);
cout<<"↓";
}else if(y_x_a[i][y]==14)
{
color(999);
cout<<"←";
}else if(y_x_a[i][y]==15)
{
color(999);
cout<<"→";
}else if(y_x_a[i][y]==16)
{
color(228);
cout<<"[]";
}else if(y_x_a[i][y]==17)
{
color(228);
cout<<"[]";
}else if(y_x_a[i][y]==18)
{
color(1001);
cout<<"()";
}else if(y_x_a[i][y]==19)
{
color(1001);
cout<<"()";
}
else
{
color(238);
cout<<"■";
}
}else if(d_t=="化工厂")
{
if(y_x_a[i][y]==2)
{
if(h_s_f_s_l==false)
color(36);
else{
if(y_x_d_t[i][y]==4)
color(116);
else if(y_x_d_t[i][y]==1)
color(164);
}
cout<<"●";
}
else if(y_x_a[i][y]==1)
{
color(170);
cout<<"■";
}
else if(y_x_a[i][y]==3)
{
if(l_s_f_s_l==false)
color(41);
else{
if(y_x_d_t[i][y]==4)
color(113);
else if(y_x_d_t[i][y]==1)
color(169);
}
cout<<"●";
}
else if(y_x_a[i][y]==4)
{
color(120);
cout<<"×";
}else if(y_x_a[i][y]==5)
{
color(40);
cout<<"○";
}else if(y_x_a[i][y]==7)
{
color(42);
cout<<"◣";
}else if(y_x_a[i][y]==9)
{
color(42);
cout<<"◢";
}else if(y_x_a[i][y]==6)
{
color(42);
cout<<"**";
}else if(y_x_a[i][y]==20)
{
color(42);
cout<<"◥";
}else if(y_x_a[i][y]==10)
{
color(42);
cout<<"◤";
}else if(y_x_a[i][y]==11)
{
color(40);
cout<<"Π";
}else if(y_x_a[i][y]==12)
{
color(40);
cout<<"↑";
}else if(y_x_a[i][y]==13)
{
color(40);
cout<<"↓";
}else if(y_x_a[i][y]==14)
{
color(40);
cout<<"←";
}else if(y_x_a[i][y]==15)
{
color(40);
cout<<"→";
}else
{
color(34);
cout<<"■";
}
}
}
cout<<endl;
}
color(7);
cout<<"蓝任务进度:"<<r_w_j_d<<"%"<<endl;
cout<<"红剩余"<<h_dd<<"次传送机会"<<endl<<"蓝剩余"<<l_dd<<"次传送机会"<<endl;
if(n>='A'&&n<='Z')
cout<<"请切换小写英文模式(按“Caps look”键)"<<endl;
n=getch();
if(n=='w')
{
if(y_x_a[h_y-1][h_x]==3&&y_x_d_t[h_y][h_x]==12)
h_sl();
else if(y_x_a[h_y-1][h_x]==3&&l_s_f_s_l==false)
h_sl();
else if(y_x_a[h_y-1][h_x]==3&&l_s_f_s_l==true&&h_s_f_s_l==true)
h_sl();
else if(y_x_d_t[h_y-1][h_x]==16||y_x_d_t[h_y-1][h_x]==17)
{
if(h_dd>0)
if(y_x_d_t[h_y-1][h_x]==16&&y_x_a[4][7]!=3)
{
y_x_a[4][7]=2;
y_x_a[h_y][h_x]=y_x_d_t[h_y][h_x];
h_y=4;
h_x=7;
h_s_f_s_l=false;
h_dd--;
}else{
if(y_x_a[12][14]!=3)
{
y_x_a[12][14]=2;
y_x_a[h_y][h_x]=y_x_d_t[h_y][h_x];
h_y=12;
h_x=14;
h_s_f_s_l=false;
h_dd--;
}
}
}else if(h_s_f_s_l==false&&y_x_a[h_y-1][h_x]!=1&&y_x_a[h_y-1][h_x]!=4&&y_x_a[h_y-1][h_x]!=11&&y_x_a[h_y-1][h_x]!=10&&y_x_a[h_y-1][h_x]!=20&&y_x_a[h_y-1][h_x]!=7&&y_x_a[h_y-1][h_x]!=9)
{
if(y_x_a[h_y-1][h_x]==3&&(l_s_f_s_l!=true||h_s_f_s_l==true))
{
y_x_a[h_y-1][h_x]=2;
y_x_a[h_y][h_x]=y_x_d_t[h_y][h_x];
h_y--;
}else if(y_x_a[h_y-1][h_x]!=3)
{
y_x_a[h_y-1][h_x]=2;
y_x_a[h_y][h_x]=y_x_d_t[h_y][h_x];
h_y--;
}
}else if(y_x_a[h_y-1][h_x]!=10&&y_x_a[h_y-1][h_x]!=7&&y_x_a[h_y-1][h_x]!=9&&y_x_a[h_y-1][h_x]!=20&&(y_x_d_t[h_y][h_x]==12||y_x_d_t[h_y][h_x]==1||y_x_d_t[h_y][h_x]==4))
{
y_x_a[h_y-1][h_x]=2;
y_x_a[h_y][h_x]=y_x_d_t[h_y][h_x];
h_y--;
h_s_f_s_l=true;
}
}else if(n=='s')
{
if(y_x_a[h_y+1][h_x]==3&&y_x_d_t[h_y][h_x]==13)
h_sl();
else if(y_x_a[h_y+1][h_x]==3&&l_s_f_s_l==false)
h_sl();
else if(y_x_a[h_y+1][h_x]==3&&l_s_f_s_l==true&&h_s_f_s_l==true)
h_sl();
else if(y_x_d_t[h_y+1][h_x]==16||y_x_d_t[h_y+1][h_x]==17)
{
if(h_dd>0)
if(y_x_d_t[h_y+1][h_x]==16&&y_x_a[4][7]!=3)
{
y_x_a[4][7]=2;
y_x_a[h_y][h_x]=y_x_d_t[h_y][h_x];
h_y=4;
h_x=7;
h_s_f_s_l=false;
h_dd--;
}else{
if(y_x_a[12][14]!=3)
{
y_x_a[12][14]=2;
y_x_a[h_y][h_x]=y_x_d_t[h_y][h_x];
h_y=12;
h_x=14;
h_s_f_s_l=false;
h_dd--;
}
}
}else if(h_s_f_s_l==false&&y_x_a[h_y+1][h_x]!=1&&y_x_a[h_y+1][h_x]!=4&&y_x_a[h_y+1][h_x]!=11&&y_x_a[h_y+1][h_x]!=10&&y_x_a[h_y+1][h_x]!=20&&y_x_a[h_y+1][h_x]!=7&&y_x_a[h_y+1][h_x]!=9)
{
if(y_x_a[h_y+1][h_x]==3&&(l_s_f_s_l!=true||h_s_f_s_l==true))
{
y_x_a[h_y+1][h_x]=2;
y_x_a[h_y][h_x]=y_x_d_t[h_y][h_x];
h_y++;
}else if(y_x_a[h_y+1][h_x]!=3)
{
y_x_a[h_y+1][h_x]=2;
y_x_a[h_y][h_x]=y_x_d_t[h_y][h_x];
h_y++;
}
}else if(y_x_a[h_y+1][h_x]!=10&&y_x_a[h_y+1][h_x]!=7&&y_x_a[h_y+1][h_x]!=9&&y_x_a[h_y+1][h_x]!=20&&(y_x_d_t[h_y][h_x]==13||y_x_d_t[h_y][h_x]==1||y_x_d_t[h_y][h_x]==4))
{
y_x_a[h_y+1][h_x]=2;
y_x_a[h_y][h_x]=y_x_d_t[h_y][h_x];
h_y++;
h_s_f_s_l=true;
}
}else if(n=='a')
{
if(y_x_a[h_y][h_x-1]==3&&y_x_d_t[h_y][h_x]==14)
h_sl();
else if(y_x_a[h_y][h_x-1]==3&&l_s_f_s_l==false)
h_sl();
else if(y_x_a[h_y][h_x-1]==3&&l_s_f_s_l==true&&h_s_f_s_l==true)
h_sl();
else if(y_x_d_t[h_y][h_x-1]==16||y_x_d_t[h_y][h_x-1]==17)
{
if(h_dd>0)
if(y_x_d_t[h_y][h_x-1]==16&&y_x_a[4][7]!=3)
{
y_x_a[4][7]=2;
y_x_a[h_y][h_x]=y_x_d_t[h_y][h_x];
h_y=4;
h_x=7;
h_s_f_s_l=false;
h_dd--;
}else{
if(y_x_a[12][14]!=3)
{
y_x_a[12][14]=2;
y_x_a[h_y][h_x]=y_x_d_t[h_y][h_x];
h_y=12;
h_x=14;
h_s_f_s_l=false;
h_dd--;
}
}
}else if(h_s_f_s_l==false&&y_x_a[h_y][h_x-1]!=1&&y_x_a[h_y][h_x-1]!=4&&y_x_a[h_y][h_x-1]!=11&&y_x_a[h_y][h_x-1]!=10&&y_x_a[h_y][h_x-1]!=20&&y_x_a[h_y][h_x-1]!=7&&y_x_a[h_y][h_x-1]!=9)
{
if(y_x_a[h_y][h_x-1]==3&&(l_s_f_s_l!=true||h_s_f_s_l==true))
{
y_x_a[h_y][h_x-1]=2;
y_x_a[h_y][h_x]=y_x_d_t[h_y][h_x];
h_x--;
}else if(y_x_a[h_y][h_x-1]!=3)
{
y_x_a[h_y][h_x-1]=2;
y_x_a[h_y][h_x]=y_x_d_t[h_y][h_x];
h_x--;
}
}else if(y_x_a[h_y][h_x-1]!=10&&y_x_a[h_y][h_x-1]!=7&&y_x_a[h_y][h_x-1]!=9&&y_x_a[h_y][h_x-1]!=20&&(y_x_d_t[h_y][h_x]==14||y_x_d_t[h_y][h_x]==1||y_x_d_t[h_y][h_x]==4))
{
y_x_a[h_y][h_x-1]=2;
y_x_a[h_y][h_x]=y_x_d_t[h_y][h_x];
h_x--;
h_s_f_s_l=true;
}
}
else if(n=='d')
{
if(y_x_a[h_y][h_x+1]==3&&y_x_d_t[h_y][h_x]==15)
h_sl();
else if(y_x_a[h_y][h_x+1]==3&&l_s_f_s_l==false)
h_sl();
else if(y_x_a[h_y][h_x+1]==3&&l_s_f_s_l==true&&h_s_f_s_l==true)
h_sl();
else if(y_x_d_t[h_y][h_x+1]==16||y_x_d_t[h_y][h_x+1]==17)
{
if(h_dd>0)
if(y_x_d_t[h_y][h_x+1]==16&&y_x_a[4][7]!=3)
{
y_x_a[4][7]=2;
y_x_a[h_y][h_x]=y_x_d_t[h_y][h_x];
h_y=4;
h_x=7;
h_s_f_s_l=false;
h_dd--;
}else{
if(y_x_a[12][14]!=3)
{
y_x_a[12][14]=2;
y_x_a[h_y][h_x]=y_x_d_t[h_y][h_x];
h_y=12;
h_x=14;
h_s_f_s_l=false;
h_dd--;
}
}
}else if(h_s_f_s_l==false&&y_x_a[h_y][h_x+1]!=1&&y_x_a[h_y][h_x+1]!=4&&y_x_a[h_y][h_x+1]!=11&&y_x_a[h_y][h_x+1]!=10&&y_x_a[h_y][h_x+1]!=20&&y_x_a[h_y][h_x+1]!=7&&y_x_a[h_y][h_x+1]!=9)
{
if(y_x_a[h_y][h_x+1]==3&&(l_s_f_s_l!=true||h_s_f_s_l==true))
{
y_x_a[h_y][h_x+1]=2;
y_x_a[h_y][h_x]=y_x_d_t[h_y][h_x];
h_x++;
}else if(y_x_a[h_y][h_x+1]!=3)
{
y_x_a[h_y][h_x+1]=2;
y_x_a[h_y][h_x]=y_x_d_t[h_y][h_x];
h_x++;
}
}else if(y_x_a[h_y][h_x+1]!=10&&y_x_a[h_y][h_x+1]!=7&&y_x_a[h_y][h_x+1]!=9&&y_x_a[h_y+1][h_x]!=20&&(y_x_d_t[h_y][h_x]==15||y_x_d_t[h_y][h_x]==1||y_x_d_t[h_y][h_x]==4))
{
y_x_a[h_y][h_x+1]=2;
y_x_a[h_y][h_x]=y_x_d_t[h_y][h_x];
h_x++;
h_s_f_s_l=true;
}
}else if(n=='i')
{
if(y_x_d_t[l_y-1][l_x]==18||y_x_d_t[l_y-1][l_x]==19)
{
if(l_dd>0)
if(y_x_d_t[l_y-1][l_x]==18)
{
y_x_a[13][9]=3;
y_x_a[l_y][l_x]=y_x_d_t[l_y][l_x];
l_y=13;
l_x=9;
l_s_f_s_l=false;
l_dd--;
}else{
y_x_a[9][9]=3;
y_x_a[l_y][l_x]=y_x_d_t[l_y][l_x];
l_y=9;
l_x=9;
l_s_f_s_l=false;
l_dd--;
}
}else if(l_s_f_s_l==false&&y_x_a[l_y-1][l_x]!=1&&y_x_a[l_y-1][l_x]!=4&&y_x_a[l_y-1][l_x]!=11&&y_x_a[l_y-1][l_x]!=10&&y_x_a[l_y-1][l_x]!=20&&y_x_a[l_y-1][l_x]!=7&&y_x_a[l_y-1][l_x]!=9&&y_x_a[l_y-1][l_x]!=2&&y_x_a[l_y-1][l_x]!=16&&y_x_a[l_y-1][l_x]!=17)
{
y_x_a[l_y-1][l_x]=3;
y_x_a[l_y][l_x]=y_x_d_t[l_y][l_x];
l_y--;
}else if(y_x_a[l_y-1][l_x]!=10&&y_x_a[l_y-1][l_x]!=7&&y_x_a[l_y-1][l_x]!=9&&y_x_a[l_y-1][l_x]!=20&&(y_x_d_t[l_y][l_x]==12||y_x_d_t[l_y][l_x]==1||y_x_d_t[l_y][l_x]==4)&&y_x_a[l_y-1][l_x]!=2)
{
y_x_a[l_y-1][l_x]=3;
y_x_a[l_y][l_x]=y_x_d_t[l_y][l_x];
l_y--;
l_s_f_s_l=true;
}
}
else if(n=='k')
{
if(y_x_d_t[l_y+1][l_x]==18||y_x_d_t[l_y+1][l_x]==19)
{
if(l_dd>0)
if(y_x_d_t[l_y+1][l_x]==18)
{
y_x_a[13][9]=3;
y_x_a[l_y][l_x]=y_x_d_t[l_y][l_x];
l_y=13;
l_x=9;
l_s_f_s_l=false;
l_dd--;
}else{
y_x_a[9][9]=3;
y_x_a[l_y][l_x]=y_x_d_t[l_y][l_x];
l_y=9;
l_x=9;
l_s_f_s_l=false;
l_dd--;
}
}else if(l_s_f_s_l==false&&y_x_a[l_y+1][l_x]!=1&&y_x_a[l_y+1][l_x]!=4&&y_x_a[l_y+1][l_x]!=11&&y_x_a[l_y+1][l_x]!=10&&y_x_a[l_y+1][l_x]!=20&&y_x_a[l_y+1][l_x]!=7&&y_x_a[l_y+1][l_x]!=9&&y_x_a[l_y+1][l_x]!=2&&y_x_a[l_y+1][l_x]!=16&&y_x_a[l_y+1][l_x]!=17)
{
y_x_a[l_y+1][l_x]=3;
y_x_a[l_y][l_x]=y_x_d_t[l_y][l_x];
l_y++;
}else if(y_x_a[l_y+1][l_x]!=10&&y_x_a[l_y+1][l_x]!=7&&y_x_a[l_y+1][l_x]!=9&&y_x_a[l_y+1][l_x]!=20&&(y_x_d_t[l_y][l_x]==13||y_x_d_t[l_y][l_x]==1||y_x_d_t[l_y][l_x]==4)&&y_x_a[l_y+1][l_x]!=2)
{
y_x_a[l_y+1][l_x]=3;
y_x_a[l_y][l_x]=y_x_d_t[l_y][l_x];
l_y++;
l_s_f_s_l=true;
}
}
else if(n=='j')
{
if(y_x_d_t[l_y][l_x-1]==18||y_x_d_t[l_y][l_x-1]==19)
{
if(l_dd>0)
if(y_x_d_t[l_y][l_x-1]==18)
{
y_x_a[13][9]=3;
y_x_a[l_y][l_x]=y_x_d_t[l_y][l_x];
l_y=13;
l_x=9;
l_s_f_s_l=false;
l_dd--;
}else{
y_x_a[9][9]=3;
y_x_a[l_y][l_x]=y_x_d_t[l_y][l_x];
l_y=9;
l_x=9;
l_s_f_s_l=false;
l_dd--;
}
}else if(l_s_f_s_l==false&&y_x_a[l_y][l_x-1]!=1&&y_x_a[l_y][l_x-1]!=4&&y_x_a[l_y][l_x-1]!=11&&y_x_a[l_y][l_x-1]!=10&&y_x_a[l_y][l_x-1]!=20&&y_x_a[l_y][l_x-1]!=7&&y_x_a[l_y][l_x-1]!=9&&y_x_a[l_y][l_x-1]!=2&&y_x_a[l_y][l_x-1]!=16&&y_x_a[l_y][l_x-1]!=17)
{
y_x_a[l_y][l_x-1]=3;
y_x_a[l_y][l_x]=y_x_d_t[l_y][l_x];
l_x--;
}else if(y_x_a[l_y][l_x-1]!=10&&y_x_a[l_y][l_x-1]!=7&&y_x_a[l_y][l_x-1]!=9&&y_x_a[l_y][l_x-1]!=20&&(y_x_d_t[l_y][l_x]==14||y_x_d_t[l_y][l_x]==1||y_x_d_t[l_y][l_x]==4)&&y_x_a[l_y][l_x-1]!=2)
{
y_x_a[l_y][l_x-1]=3;
y_x_a[l_y][l_x]=y_x_d_t[l_y][l_x];
l_x--;
l_s_f_s_l=true;
}
}
else if(n=='l')
{
if(y_x_d_t[l_y][l_x+1]==18||y_x_d_t[l_y][l_x+1]==19)
{
if(l_dd>0)
if(y_x_d_t[l_y][l_x+1]==18)
{
y_x_a[13][9]=3;
y_x_a[l_y][l_x]=y_x_d_t[l_y][l_x];
l_y=13;
l_x=9;
l_s_f_s_l=false;
l_dd--;
}else{
y_x_a[9][9]=3;
y_x_a[l_y][l_x]=y_x_d_t[l_y][l_x];
l_y=9;
l_x=9;
l_s_f_s_l=false;
l_dd--;
}
}else if(l_s_f_s_l==false&&y_x_a[l_y][l_x+1]!=1&&y_x_a[l_y][l_x+1]!=4&&y_x_a[l_y][l_x+1]!=11&&y_x_a[l_y][l_x+1]!=10&&y_x_a[l_y][l_x+1]!=20&&y_x_a[l_y][l_x+1]!=7&&y_x_a[l_y][l_x+1]!=9&&y_x_a[l_y][l_x+1]!=2&&y_x_a[l_y][l_x+1]!=16&&y_x_a[l_y][l_x+1]!=17)
{
y_x_a[l_y][l_x+1]=3;
y_x_a[l_y][l_x]=y_x_d_t[l_y][l_x];
l_x++;
}else if(y_x_a[l_y][l_x+1]!=10&&y_x_a[l_y][l_x+1]!=7&&y_x_a[l_y][l_x+1]!=9&&y_x_a[l_y+1][l_x]!=20&&(y_x_d_t[l_y][l_x]==15||y_x_d_t[l_y][l_x]==1||y_x_d_t[l_y][l_x]==4)&&y_x_a[l_y][l_x+1]!=2)
{
y_x_a[l_y][l_x+1]=3;
y_x_a[l_y][l_x]=y_x_d_t[l_y][l_x];
l_x++;
l_s_f_s_l=true;
}
}else if(n=='o')
{
if(y_x_a[l_y-1][l_x-1]==11||y_x_a[l_y][l_x-1]==11||y_x_a[l_y+1][l_x-1]==11||y_x_a[l_y-1][l_x]==11||y_x_a[l_y+1][l_x-1]==11||y_x_a[l_y-1][l_x+1]==11||y_x_a[l_y][l_x+1]==11||y_x_a[l_y+1][l_x+1]==11)
{
r_w_j_d+=2;
if(r_w_j_d>=100)
l_sl();
}
}
if(y_x_d_t[h_y][h_x]==0||y_x_d_t[h_y][h_x]==12||y_x_d_t[h_y][h_x]==13||y_x_d_t[h_y][h_x]==14||y_x_d_t[h_y][h_x]==15||y_x_d_t[h_y][h_x]==6||y_x_d_t[h_y][h_x]==5)
{
h_s_f_s_l=false;
}
if(y_x_d_t[l_y][l_x]==0||y_x_d_t[l_y][l_x]==12||y_x_d_t[l_y][l_x]==13||y_x_d_t[l_y][l_x]==14||y_x_d_t[l_y][l_x]==15||y_x_d_t[l_y][l_x]==6||y_x_d_t[l_y][l_x]==5)
{
l_s_f_s_l=false;
}
if(y_x_d_t[l_y][l_x]==6)
j_b();
if(js==true)
{
cout<<"按“r”键继续";
for(;;)
{
n=getch();
if(n=='r')
{
y_x_c_s_h();
return ;
}
}
}
}
}
void s_m()
{
for(int i=0;i<=19;i++)
for(int y=0;y<=19;y++)
{
y_x_a[i][y]=s_m_a[i][y];
y_x_d_t[i][y]=s_m_d_t[i][y];
}
}
void h_g_c()
{
for(int i=0;i<=19;i++)
for(int y=0;y<=19;y++)
{
y_x_a[i][y]=h_g_c_a[i][y];
y_x_d_t[i][y]=h_g_c_d_t[i][y];
}
}
int main()
{
sq();
f_c_m();
for(;;)
{
color(7);
system("cls");
cout<<"\n\n\n\n\n\n\n\n";
cout<<" 迷宫系列辐射篇"<<endl<<endl;
cout<<" 1.开始游戏"<<endl;
cout<<" 2.玩法说明"<<endl;
cout<<" 3.制作者"<<endl;
cout<<" 4.退出游戏(不建议)"<<endl;
n=getch();
if(n=='1')
{
system("cls");
cout<<"1.沙漠地图(带有传送门)"<<endl;
cout<<"2.化工厂地图"<<endl;
n=getch();
if(n=='1')
{
s_m();
d_t="沙漠";
game();
}else if(n=='2')
{
h_g_c();
d_t="化工厂";
game();
}
}else if(n=='2')
{
system("cls");
cout<<"wasd控制红球移动"<<endl<<"ijkl控制蓝球移动"<<endl<<"()[]传送门"<<endl<<"蓝球到Π时按o键可以做任务"<<endl<<"箭头可以上楼"<<endl<<"**是放射性物质蓝要小心它"<<endl<<"蓝的任务是做完100%的任务"<<endl<<"红的任务是抓到蓝"<<endl<<"建议双人游玩";
n=getch();
}else if(n=='4')
{
system("cls");
cout<<"拜拜~~";
return 0;
}else if(n=='3')
{
s_c("作者一人创做");
n=getch();
}
d_t="无";
}
}
看我干嘛关注呀!