📄 simpletank.java
字号:
//------------------------------------------------------------------------------
public class SimpleTank extends EnemyTank{
protected SimpleTank(boolean hasPrize) {
super(hasPrize);
score=Score.SCORE_100;
}
public void think(){
//Move blindly.
int changeDirection=Math.abs(rnd.nextInt()) % 100;
if(changeDirection>90){
direction =Math.abs(rnd.nextInt()) % 4;
}else if(changeDirection>80){
direction =BattleField.SOUTH;
}
int shooting=Math.abs(rnd.nextInt()) % 100;
shoot=false;
//shooting blindly.
if(shooting>=50) {
shoot=true;
}
super.think();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -