fix(MCU课设): 修复方块移动bug

This commit is contained in:
iridiumR 2022-06-06 17:10:00 +08:00
parent 0438b82ff7
commit 926ec204cc

View file

@ -90,7 +90,7 @@ void genPiece()
//动作是否在屏幕内
unsigned char isIegal(char i, char j)
{
if(i >= 0 && i < MAX_X && j >= 0 && j < MAX_Y && base[i][j] == 0)
if(i >= 0 && i < MAX_X && j >= 0 && j < MAX_Y && base[i][j] != 1)
return 1;
return 0;
}
@ -172,7 +172,6 @@ void moveLeftPiece()
{
base[i - 1][j] = 2;
base[i][j] = 0;
return;
}
}
void moveRightPiece()