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