MCPcopy Create free account
hub / github.com/TanaStudy/Java-Study / draw

Method draw

8. Demo/Java/src/main/LeetCode/Tetris/Main.java:210–223  ·  view source on GitHub ↗
(int m, int n)

Source from the content-addressed store, hash-verified

208 }
209 /*绘制掉落后方块图像*/
210 public void draw(int m, int n) {
211 int temp = 0x8000;//表示1000 0000 0000 0000
212 for (int i = 0; i < 4; i++) {//循环遍历16个方格(4*4)
213 for (int j = 0; j < 4; j++) {
214 if ((temp & rect) != 0) {// 此处有方块时
215 grids[m][n].setBackground(Color.GREEN);//有方块的地方变为绿色
216 }
217 n++;//下一列
218 temp >>= 1;
219 }
220 m++;//下一行
221 n = n - 4;//回到首列
222 }
223 }
224
225 @Override
226 public void keyPressed(KeyEvent e) {

Callers 7

fallMethod · 0.95
keyTypedMethod · 0.95
highcharts.src.jsFile · 0.80
highcharts.jsFile · 0.80
Chart.min.jsFile · 0.80
Chart.min.jsFile · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected