?? mygroundlistener.java
字號:
package cn.itcast.tetris.game;
import cn.itcast.tetris.entities.Ground;
import cn.itcast.tetris.listener.GroundAdapter;
import cn.itcast.tetris.util.Global;
/**
* 自己用的一個GroundListener, 處理不可消的障礙物, 增加趣味性
*
* @version 1.0, 01/01/08
*
* @author 湯陽光
*
*/
public class MyGroundListener extends GroundAdapter {
int deletedLineCount = 0;
@Override
public void fullLineDeleted(Ground ground, int deletedLineCount) {
this.deletedLineCount += deletedLineCount;
// TODO Auto-generated method stub
if ((deletedLineCount %= 10) == 9 || deletedLineCount > 2)
for (int y = 0; y < Global.HEIGHT; y++)
for (int x = 0; x < Global.WIDTH; x++)
if (ground.isStubbornObstacle(x, y))
ground.addObstacle(x, y);
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -