PLAYER_LEVEL = 1;
ENEMY_MAX = PLAYER_LEVEL * 10;
ENEMY_CURRENT = 0;
TRIGGER_COUNT = 0;
SEABACK_DENSITY = 0;
ENEMY_CURRENT_LIMIT = PLAYER_LEVEL * 2;
}
/**
* 程序作为线程, 每50ms运行刷新一次
*/
public void run() {
//利用条件驱动线程
while(threadAlive){
try {
Thread.sleep(25);
} catch (InterruptedException e) {
e.printStackTrace();
}
//分离对玩家潜艇和普通物体的响应速度(一倍)
if(gameState == GAME_RUN){
mySub.movePosition(getKeyStates());
}
if((TICK_COUNT % 2) == 0){
// 重画事件
this.paintCanvas(graphics);