Package battleTank

Examples of battleTank.PlayerTank.recieveDamage()


      FireRing fr = (FireRing) o;
      for (int i = 0; i < tankList.size(); i++) {
        PlayerTank t = tankList.get(i);
        if (t.getRectangle().intersects(fr.getRectangle())) {
          notifyObservers(new Point(t.getLocation().row - 12, t.getLocation().col - 12));
          t.recieveDamage(1);
          setChanged();
          break;
        }
      }
      notifyObservers("Fire " + fr.getLocation().col + " " + fr.getLocation().row);
View Full Code Here


        // If the PlayerTank collides with a FireRing it will die
        if (obs instanceof FireRing) {
          FireRing c = (FireRing) obs;
          if (rect.intersects(c.getRectangle())) {
            notifyObservers(new Point(p.getLocation().row - 12, p.getLocation().col - 12));
            p.recieveDamage(1);
          }
        }
        // If the PlayerTank collides with a SpikePit it will die
        if (obs instanceof SpikePit) {
          SpikePit c = (SpikePit) obs;
View Full Code Here

        // If the PlayerTank collides with a SpikePit it will die
        if (obs instanceof SpikePit) {
          SpikePit c = (SpikePit) obs;
          if (rect.intersects(c.getRectangle())) {
            notifyObservers(new Point(p.getLocation().row - 12, p.getLocation().col - 12));
            p.recieveDamage(1);
          }
        }
      }
       
      notifyObservers();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.