檢測(cè)點(diǎn)是否合法的那個(gè)Check函數(shù)里面有點(diǎn)問題
在清除數(shù)據(jù)clear的函數(shù)中調(diào)用check的時(shí)候,gamedata為上次的數(shù)據(jù),那么curdata的那個(gè)位置是有數(shù)據(jù)的,所以gameData[pos.x+x][pos.y+y]==1,就會(huì)返回false,所以造成無法清楚數(shù)據(jù)。
在清除數(shù)據(jù)clear的函數(shù)中調(diào)用check的時(shí)候,gamedata為上次的數(shù)據(jù),那么curdata的那個(gè)位置是有數(shù)據(jù)的,所以gameData[pos.x+x][pos.y+y]==1,就會(huì)返回false,所以造成無法清楚數(shù)據(jù)。
舉報(bào)
2018-03-23
找到問題在哪里了。數(shù)組里1代表的是已經(jīng)落下的方塊? ?我Square里的data設(shè)置的不是2是1
2018-03-23
我在加了這個(gè)判斷后都不能移動(dòng)了。。
else if (gameData[pos.x + x][pos.y + y] === 1) {
? ? ? ? ? ? return false;
? ? ? ? }
去掉以后才能移動(dòng)
2018-01-25
沒毛病啊