Package rectangles

Examples of rectangles.TankRectangle.intersects()


     
    }
      if(p instanceof IceBlock) {
        IceBlock s = (IceBlock)p;
        IceBlockRectangle tRect = s.getRectangle();
        if(tRect.intersects(rect)) {
          return false;
        }
       
      }
     
View Full Code Here


    for (int i = 0; i < obs.size(); i++) {
      Obstacle p = obs.get(i);
      if (p instanceof Crate) {// for instance of crate
        Crate c = (Crate) p;
        CrateRectangle tRect = c.getRectangle();
        if(tRect.intersects(rect)) {
          return false;
        }
       
      }
      if (p instanceof ImmovableBlock) {// for instance of immovableBlock
View Full Code Here

       
      }
      if (p instanceof ImmovableBlock) {// for instance of immovableBlock
        ImmovableBlock ib = (ImmovableBlock) p;
        ImmovableBlockRectangle tRect = ib.getRectangle();
        if(tRect.intersects(rect)) {
          return false;
        }
       
      }
      if (p instanceof SpikePit) {// for instance of SpikePit
View Full Code Here

       
      }
      if (p instanceof SpikePit) {// for instance of SpikePit
        SpikePit sp = (SpikePit) p;
        SpikePitRectangle tRect = sp.getRectangle();
        if(tRect.intersects(rect)) {
          return false;
        }
       
      }
      if (p instanceof FireRing) {// for instance of fireRing
View Full Code Here

       
      }
      if (p instanceof FireRing) {// for instance of fireRing
        FireRing fr = (FireRing) p;
        FireRingRectangle tRect = fr.getRectangle();
        if(tRect.intersects(rect)) {
          return false;
        }
       
      }
      if (p instanceof TNT) {// for instance of TNT
View Full Code Here

       
      }
      if (p instanceof TNT) {// for instance of TNT
        TNT tnt = (TNT) p;
        TNTRectangle tRect = tnt.getRectangle();
        if(tRect.intersects(rect)) {
          return false;
        }
       
      }
View Full Code Here

      }
      for (Obstacle obs : obstacleList) {
        // This tank will push the crate if the crate is movable
        if (obs instanceof Crate) {
          Crate c = (Crate) obs;
          if (rect.intersects(c.getRectangle())) {
            c.move(tankList.getFirst().getDirection());
          }
        }
        // This tank will push the TNT if the TNT is movable
        if (obs instanceof TNT) {
View Full Code Here

          }
        }
        // This tank will push the TNT if the TNT is movable
        if (obs instanceof TNT) {
          TNT c = (TNT) obs;
          if (rect.intersects(c.getRectangle())) {
            c.move(tankList.getFirst().getDirection());
          }
        }
        // FireRing's can not kill the AI for difficulty purposes
        if (obs instanceof FireRing) {
View Full Code Here

          }
        }
        // FireRing's can not kill the AI for difficulty purposes
        if (obs instanceof FireRing) {
          FireRing c = (FireRing) obs;
          if (rect.intersects(c.getRectangle())) {
            p.recieveDamage(1);
            notifyObservers();
            setChanged();
           
          }
View Full Code Here

          }
        }
        // SpikePit's can not kill the AI either for difficulty purposes
        if (obs instanceof SpikePit) {
          SpikePit c = (SpikePit) obs;
          if (rect.intersects(c.getRectangle())) {
            p.recieveDamage(1);
            notifyObservers();
            setChanged();
          }
        }
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.