⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 simpletank.java

📁 J2ME超级坦克大战源码
💻 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 + -