📄 escape.cpp
字号:
temp[x+1][y].station=3;
temp[x+1][y+1].sign=0;
temp[x+1][y+1].sign_1=13;
temp[x+1][y+1].station=4;
temp[x-1][y].sign=6;
temp[x-1][y].sign_1=0;
temp[x-1][y].station=0;
temp[x-1][y+1].sign=6;
temp[x-1][y+1].sign_1=0;
temp[x-1][y+1].station=0;
ChangDraw(hwnd,y,y+2,x-1,x,7,y,y+2,x,x+2,13);
move_flag=1;
}
}
else
if(temp[x][y].station==4)
if((temp[x+1][y-1].sign_1==0)&&(temp[x+1][y].sign_1==0))
{
temp[x][y-1].sign=13;
temp[x][y-1].sign_1=13;
temp[x][y-1].station=1;
temp[x][y].sign=0;
temp[x][y].sign_1=13;
temp[x][y].station=2;
temp[x+1][y-1].sign=0;
temp[x+1][y-1].sign_1=13;
temp[x+1][y-1].station=3;
temp[x+1][y].sign=0;
temp[x+1][y].sign_1=13;
temp[x+1][y].station=4;
temp[x-1][y-1].sign=6;
temp[x-1][y-1].sign_1=0;
temp[x-1][y-1].station=0;
temp[x-1][y].sign=6;
temp[x-1][y].sign_1=0;
temp[x-1][y].station=0;
ChangDraw(hwnd,y-1,y+1,x-1,x,7,y-1,y+1,x,x+2,13);
move_flag=1;
}
}
break;
case 10:
if(section==left)
{
if(temp[x][y].station==1)
{
if(temp[x][y-1].sign_1==0)
{
temp[x][y-1].sign=10;
temp[x][y-1].sign_1=10;
temp[x][y-1].station=1;
temp[x][y].sign=0;
temp[x][y].sign_1=10;
temp[x][y].station=2;
temp[x][y+1].sign=0;
temp[x][y+1].sign_1=10;
temp[x][y+1].station=3;
temp[x][y+2].sign=6;
temp[x][y+2].sign_1=0;
temp[x][y+2].station=0;
ChangDraw(hwnd,y+2,y+3,x,x+1,6,y-1,y+2,x,x+1,10);
move_flag=1;
}
}
else
if(temp[x][y].station==2)
{
if(temp[x][y-2].sign_1==0)
{
temp[x][y-2].sign=10;
temp[x][y-2].sign_1=10;
temp[x][y-2].station=1;
temp[x][y-1].sign=0;
temp[x][y-1].sign_1=10;
temp[x][y-1].station=2;
temp[x][y].sign=0;
temp[x][y].sign_1=10;
temp[x][y].station=3;
temp[x][y+1].sign=6;
temp[x][y+1].sign_1=0;
temp[x][y+1].station=0;
ChangDraw(hwnd,y+1,y+2,x,x+1,6,y-2,y+1,x,x+1,10);
move_flag=1;
}
}
else
if(temp[x][y-3].sign_1==0)
{
temp[x][y-3].sign=10;
temp[x][y-3].sign_1=10;
temp[x][y-3].station=1;
temp[x][y-2].sign=0;
temp[x][y-2].sign_1=10;
temp[x][y-2].station=2;
temp[x][y-1].sign=0;
temp[x][y-1].sign_1=10;
temp[x][y-1].station=3;
temp[x][y].sign=6;
temp[x][y].sign_1=0;
temp[x][y].station=0;
ChangDraw(hwnd,y,y+1,x,x+1,6,y-3,y,x,x+1,10);
move_flag=1;
}
}
if(section==right)
{
if(temp[x][y].station==1)
if((temp[x][y+3].sign_1==0)||(temp[x][y+3].sign_1==1))
{
temp[x][y+3].sign=0;
temp[x][y+3].sign_1=10;
temp[x][y+3].station=3;
temp[x][y+2].sign=0;
temp[x][y+2].sign_1=10;
temp[x][y+2].station=2;
temp[x][y+1].sign=10;
temp[x][y+1].sign_1=10;
temp[x][y+1].station=1;
temp[x][y].sign=6;
temp[x][y].sign_1=0;
temp[x][y].station=0;
ChangDraw(hwnd,y,y+1,x,x+1,6,y+1,y+4,x,x+1,10);
move_flag=1;
}
if(temp[x][y].station==2)
if((temp[x][y+2].sign_1==0)||(temp[x][y+2].sign_1==1))
{
temp[x][y+2].sign=0;
temp[x][y+2].sign_1=10;
temp[x][y+2].station=3;
temp[x][y+1].sign=0;
temp[x][y+1].sign_1=10;
temp[x][y+1].station=2;
temp[x][y].sign=10;
temp[x][y].sign_1=10;
temp[x][y].station=1;
temp[x][y-1].sign=6;
temp[x][y-1].sign_1=0;
temp[x][y-1].station=0;
ChangDraw(hwnd,y-1,y,x,x+1,6,y,y+3,x,x+1,10);
move_flag=1;
}
if(temp[x][y].station==3)
if((temp[x][y+1].sign_1==0)||(temp[x][y+1].sign_1==1))
{
temp[x][y+1].sign=0;
temp[x][y+1].sign_1=10;
temp[x][y+1].station=3;
temp[x][y].sign=0;
temp[x][y].sign_1=10;
temp[x][y].station=2;
temp[x][y-1].sign=10;
temp[x][y-1].sign_1=10;
temp[x][y-1].station=1;
temp[x][y-2].sign=6;
temp[x][y-2].sign_1=0;
temp[x][y-2].station=0;
ChangDraw(hwnd,y-2,y-1,x,x+1,6,y-1,y+2,x,x+1,10);
move_flag=1;
}
}
if(section==up)
{
if(temp[x][y].station==1)
if((temp[x-1][y].sign_1==0)&&(temp[x-1][y+1].sign_1==0)
&&(temp[x-1][y+2].sign_1==0))
{
temp[x-1][y].sign=10;
temp[x-1][y].sign_1=10;
temp[x-1][y].station=1;
temp[x-1][y+1].sign=0;
temp[x-1][y+1].sign_1=10;
temp[x-1][y+1].station=2;
temp[x-1][y+2].sign=0;
temp[x-1][y+2].sign_1=10;
temp[x-1][y+2].station=3;
temp[x][y].sign=6;
temp[x][y].sign_1=0;
temp[x][y].station=0;
temp[x][y+1].sign=6;
temp[x][y+1].sign_1=0;
temp[x][y+1].station=0;
temp[x][y+2].sign=6;
temp[x][y+2].sign_1=0;
temp[x][y+2].station=0;
ChangDraw(hwnd,y,y+3,x,x+1,11,y,y+3,x-1,x,10);
move_flag=1;
}
if(temp[x][y].station==2)
if((temp[x-1][y-1].sign_1==0)&&(temp[x-1][y].sign_1==0)
&&(temp[x-1][y+1].sign_1==0))
{
temp[x-1][y-1].sign=10;
temp[x-1][y-1].sign_1=10;
temp[x-1][y-1].station=1;
temp[x-1][y].sign=0;
temp[x-1][y].sign_1=10;
temp[x-1][y].station=2;
temp[x-1][y+1].sign=0;
temp[x-1][y+1].sign_1=10;
temp[x-1][y+1].station=3;
temp[x][y-1].sign=6;
temp[x][y-1].sign_1=0;
temp[x][y-1].station=0;
temp[x][y].sign=6;
temp[x][y].sign_1=0;
temp[x][y].station=0;
temp[x][y+1].sign=6;
temp[x][y+1].sign_1=0;
temp[x][y+1].station=0;
ChangDraw(hwnd,y-1,y+2,x,x+1,11,y-1,y+2,x-1,x,10);
move_flag=1;
}
if(temp[x][y].station==3)
if((temp[x-1][y-2].sign_1==0)&&(temp[x-1][y-1].sign_1==0)
&&(temp[x-1][y].sign_1==0))
{
temp[x-1][y-2].sign=10;
temp[x-1][y-2].sign_1=10;
temp[x-1][y-2].station=1;
temp[x-1][y-1].sign=0;
temp[x-1][y-1].sign_1=10;
temp[x-1][y-1].station=2;
temp[x-1][y].sign=0;
temp[x-1][y].sign_1=10;
temp[x-1][y].station=3;
temp[x][y-2].sign=6;
temp[x][y-2].sign_1=0;
temp[x][y-2].station=0;
temp[x][y-1].sign=6;
temp[x][y-1].sign_1=0;
temp[x][y-1].station=0;
temp[x][y].sign=6;
temp[x][y].sign_1=0;
temp[x][y].station=0;
ChangDraw(hwnd,y-2,y+1,x,x+1,11,y-2,y+1,x-1,x,10);
move_flag=1;
}
}
if(section==down)
{
if(temp[x][y].station==1)
if((temp[x+1][y].sign_1==0)&&(temp[x+1][y+1].sign_1==0)
&&(temp[x+1][y+2].sign_1==0))
{
temp[x+1][y].sign=10;
temp[x+1][y].sign_1=10;
temp[x+1][y].station=1;
temp[x+1][y+1].sign=0;
temp[x+1][y+1].sign_1=10;
temp[x+1][y+1].station=2;
temp[x+1][y+2].sign=0;
temp[x+1][y+2].sign_1=10;
temp[x+1][y+2].station=3;
temp[x][y].sign=6;
temp[x][y].sign_1=0;
temp[x][y].station=0;
temp[x][y+1].sign=6;
temp[x][y+1].sign_1=0;
temp[x][y+1].station=0;
temp[x][y+2].sign=6;
temp[x][y+2].sign_1=0;
temp[x][y+2].station=0;
ChangDraw(hwnd,y,y+3,x,x+1,11,y,y+3,x+1,x+2,10);
move_flag=1;
}
if(temp[x][y].station==2)
if((temp[x+1][y-1].sign_1==0)&&(temp[x+1][y].sign_1==0)
&&(temp[x+1][y+1].sign_1==0))
{
temp[x+1][y-1].sign=10;
temp[x+1][y-1].sign_1=10;
temp[x+1][y-1].station=1;
temp[x+1][y].sign=0;
temp[x+1][y].sign_1=10;
temp[x+1][y].station=2;
temp[x+1][y+1].sign=0;
temp[x+1][y+1].sign_1=10;
temp[x+1][y+1].station=3;
temp[x][y-1].sign=6;
temp[x][y-1].sign_1=0;
temp[x][y-1].station=0;
temp[x][y].sign=6;
temp[x][y].sign_1=0;
temp[x][y].station=0;
temp[x][y+1].sign=6;
temp[x][y+1].sign_1=0;
temp[x][y+1].station=0;
ChangDraw(hwnd,y-1,y+2,x,x+1,11,y-1,y+2,x+1,x+2,10);
move_flag=1;
}
if(temp[x][y].station==3)
if((temp[x+1][y-2].sign_1==0)&&(temp[x+1][y-1].sign_1==0)
&&(temp[x+1][y].sign_1==0))
{
temp[x+1][y-2].sign=10;
temp[x+1][y-2].sign_1=10;
temp[x+1][y-2].station=1;
temp[x+1][y-1].sign=0;
temp[x+1][y-1].sign_1=10;
temp[x+1][y-1].station=2;
temp[x+1][y].sign=0;
temp[x+1][y].sign_1=10;
temp[x+1][y].station=3;
temp[x][y-2].sign=6;
temp[x][y-2].sign_1=0;
temp[x][y-2].station=0;
temp[x][y-1].sign=6;
temp[x][y-1].sign_1=0;
temp[x][y-1].station=0;
temp[x][y].sign=6;
temp[x][y].sign_1=0;
temp[x][y].station=0;
ChangDraw(hwnd,y-2,y+1,x,x+1,11,y-2,y+1,x+1,x+2,10);
move_flag=1;
}
}
break;
case 12:
if(section==left)
{
if(temp[x][y].station==1)
{
if(temp[x][y-1].sign_1==0)
{
temp[x][y-1].sign=12;
temp[x][y-1].sign_1=12;
temp[x][y-1].station=1;
temp[x][y].sign=0;
temp[x][y].sign_1=12;
temp[x][y].station=2;
temp[x][y+1].sign=6;
temp[x][y+1].sign_1=0;
temp[x][y+1].station=0;
ChangDraw(hwnd,y+1,y+2,x,x+1,6,y-1,y+1,x,x+1,12);
move_flag=1;
}
}
else
if(temp[x][y-2].sign_1==0)
{
temp[x][y-2].sign=12;
temp[x][y-2].sign_1=12;
temp[x][y-2].station=1;
temp[x][y-1].sign=0;
temp[x][y-1].sign_1=12;
temp[x][y-1].station=2;
temp[x][y].sign=6;
temp[x][y].sign_1=0;
temp[x][y].station=0;
ChangDraw(hwnd,y,y+1,x,x+1,6,y-2,y,x,x+1,12);
move_flag=1;
}
}
if(section==right)
{
if(temp[x][y].station==1)
if((temp[x][y+2].sign_1==0)||(temp[x][y+2].sign_1==1))
{
temp[x][y+2].sign=0;
temp[x][y+2].sign_1=12;
temp[x][y+2].station=2;
temp[x][y+1].sign=12;
temp[x][y+1].sign_1=12;
temp[x][y+1].station=1;
temp[x][y].sign=6;
temp[x][y].sign_1=0;
temp[x][y].station=0;
ChangDraw(hwnd,y,y+1,x,x+1,6,y+1,y+3,x,x+1,12);
move_flag=1;
}
if(temp[x][y].station==2)
if((temp[x][y+1].sign_1==0)||(temp[x][y+1].sign_1==1))
{
temp[x][y+1].sign=0;
temp[x][y+1].sign_1=12;
temp[x][y+1].station=2;
temp[x][y].sign=12;
temp[x][y].sign_1=12;
temp[x][y].station=1;
temp[x][y-1].sign=6;
temp[x][y-1].sign_1=0;
temp[x][y-1].station=0;
ChangDraw(hwnd,y-1,y,x,x+1,6,y,y+2,x,x+1,12);
move_flag=1;
}
}
if(section==up)
{
if(temp[x][y].station==1)
if((temp[x-1][y].sign_1==0)&&(temp[x-1][y+1].sign_1==0))
{
temp[x-1][y].sign=12;
temp[x-1][y].sign_1=12;
temp[x-1][y].station=1;
temp[x-1][y+1].sign=0;
temp[x-1][y+1].sign_1=12;
temp[x-1][y+1].station=2;
temp[x][y].sign=6;
temp[x][y].sign_1=0;
temp[x][y].station=0;
temp[x][y+1].sign=6;
temp[x][y+1].sign_1=0;
temp[x][y+1].station=0;
ChangDraw(hwnd,y,y+2,x,x+1,7,y,y+2,x-1,x,12);
move_flag=1;
}
if(temp[x][y].station==2)
if((temp[x-1][y-1].sign_1==0)&&(temp[x-1][y].sign_1==0))
{
temp[x-1][y-1].sign=12;
temp[x-1][y-1].sign_1=12;
temp[x-1][y-1].station=1;
temp[x-1][y].sign=0;
temp[x-1][y].sign_1=12;
temp[x-1][y].station=2;
temp[x][y-1].sign=6;
temp[x][y-1].sign_1=0;
temp[x][y-1].station=0;
temp[x][y].sign=6;
temp[x][y].sign_1=0;
temp[x][y].station=0;
ChangDraw(hwnd,y-1,y+1,x,x+1,7,y-1,y+1,x-1,x,12);
move_flag=1;
}
}
if(section==down)
{
if(temp[x][y].station==1)
if((temp[x+1][y].sign_1==0)&&(temp[x+1][y+1].sign_1==0))
{
temp[x+1][y].sign=12;
temp[x+1][y].sign_1=12;
temp[x+1][y].station=1;
temp[x+1][y+1].sign=0;
temp[x+1][y+1].sign_1=12;
temp[x+1][y+1].station=2;
temp[x][y].sign=6;
temp[x][y].sign_1=0;
temp[x][y].station=0;
temp[x][y+1].sign=6;
temp[x][y+1].sign_1=0;
temp[x][y+1].station=0;
ChangDraw(hwnd,y,y+2,x,x+1,7,y,y+2,x+1,x+2,12);
move_flag=1;
}
if(temp[x][y].station==2)
if((temp[x+1][y-1].sign_1==0)&&(temp[x+1][y].sign_1==0))
{
temp[x+1][y-1].sign=12;
temp[x+1][y-1].sign_1=12;
temp[x+1][y-1].station=1;
temp[x+1][y].sign=0;
temp[x+1][y].sign_1=12;
temp[x+1][y].station=2;
temp[x][y-1].sign=6;
temp[x][y-1].sign_1=0;
temp[x][y-1].station=0;
temp[x][y].sign=6;
temp[x][y].sign_1=0;
temp[x][y].station=0;
ChangDraw(hwnd,y-1,y+1,x,x+1,7,y-1,y+1,x+1,x+2,12);
move_flag=1;
}
}
break;
}
Pass(hwnd);
if(move_flag=
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -