public class Test{
public static void main(String[] args){
Airplane a = new Airplane();
Bullet b = new Bullet(95,220);
boolean flag = a.hit(b);
System.out.println(flag);
}
}
for(){
for(){
if (f instanceof Enemy){
Enemy
e = (Enemy)f;
score+=e.getScore();//玩家得分
}
if(f instanceof Award){
Award a =(Award)f;
int type = a.getType();
switch(type){
case
Award.DOUBLE_FIRE;
hero.addDoubleFire();
break;
case
Award.LIFE;
hero.addLife();
break;
}
}
}
}
public int getLife(){
return life;
}