C语言实现推箱子游戏完整代码 (4)

向下移动

void moves(){ if(x<9){ if(screen[x+1][y]==1){ return ; }else if(screen[x+1][y]==0){ screen[x+1][y]+=3; screen[x][y]-=3; x++; }else if(screen[x+1][y]==4){ screen [x+1][y]+=3; screen[x][y]-=3; x++; } else if(screen[x+1][y]==2||screen[x+1][y]==6){ if(screen[x+2][y]==1){ return; }else if(screen[x+2][y]==0){ screen[x+2][y]+=2; screen[x+1][y]+=1; screen[x][y]-=3; x++; }else if(screen[x+2][y]==2){ return ; }else if(screen[x+2][y]==4){ screen[x+2][y]+=2; screen[x+1][y]+=1; screen[x][y]-=3; x++; } } } }

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/zwxgfs.html