Пример #1
0
 public boolean hitTank(Tank t) {
   boolean bHitted = false;
   if (this.getRec().intersects(t.getRec()) && this.bGood != t.isGood()) {
     Explode e = new Explode(x, y);
     tc.explodes.add(e);
     if (t.isGood()) {
       int i = t.getLives();
       i--;
       t.setLives(i);
       if (i <= 0) {
         t.setLive(false);
       }
     } else {
       t.setLive(false);
     }
     bHitted = true;
     this.bLive = false;
   }
   return bHitted;
 }