this.tick();
}
TICK_COUNT ++;
}
}
protected synchronized void keyPressed(int keyCode){
int action = getGameAction(keyCode);
if(action == Canvas.FIRE && gameState == GAME_RUN){
//玩家潜艇开火
if(mySub != null){
mySub.fire();
}
}
}
/**
* 秒触发器
*/
public synchronized void tick(){
//主动查询状态
int keyState = getKeyStates();
if(gameState != GAME_OVER){
//执行鱼类图形运动
this.tickFishes();
//执行鱼雷触发