(int m, int n)
| 193 | } |
| 194 | /*清除方块掉落之前有颜色的地方*/ |
| 195 | public void clear(int m, int n) { |
| 196 | int temp = 0x8000;//表示1000 0000 0000 0000 |
| 197 | for (int i = 0; i < 4; i++) {//循环遍历16个方格(4*4) |
| 198 | for (int j = 0; j < 4; j++) { |
| 199 | if ((temp & rect) != 0) {// 此处有方块时 |
| 200 | grids[m][n].setBackground(Color.WHITE);//清除颜色,变为白色 |
| 201 | } |
| 202 | n++;//下一列 |
| 203 | temp >>= 1; |
| 204 | } |
| 205 | m++;//下一行 |
| 206 | n = n - 4;//回到首列 |
| 207 | } |
| 208 | } |
| 209 | /*绘制掉落后方块图像*/ |
| 210 | public void draw(int m, int n) { |
| 211 | int temp = 0x8000;//表示1000 0000 0000 0000 |
no outgoing calls
no test coverage detected