Examples of collided()


Examples of battleTank.PlayerProjectile.collided()

            }
          }
          if (i instanceof SpeedBoost) {
            SpeedBoost c = (SpeedBoost) i;
            if (c.getRectangle().intersects(p.getRectangle())) {
              p.collided();
              projectileList.remove(p);
              itemList.remove(c);
              notifyObservers(new Point(c.getLocation().row - 12, c.getLocation().col - 12));
              setChanged();
              break;
View Full Code Here

Examples of battleTank.PlayerProjectile.collided()

       
        //Removes the PlayerTank if it is hit by the EnemyTank's projectile
       
        for (PlayerTank h : tankList) {
          if (h.getRectangle().intersects(p.getRectangle())) {
            p.collided();
            projectileList.remove(p);
            notifyObservers(new Point(h.getLocation().row - 12, h.getLocation().col - 12));
            setChanged();
            h.recieveDamage(p.getDamage());
            break;
View Full Code Here

Examples of battleTank.PlayerProjectile.collided()

          // Crate's are destroyed when a projectile collides with them
         
          if (obs instanceof Crate) {
            Crate c = (Crate) obs;
            if (c.getRectangle().intersects(p.getRectangle())) {
              p.collided();
              projectileList.remove(p);
              notifyObservers(new Point(c.getLocation().row - 12, c.getLocation().col - 12));
              setChanged();
              c.recieveDamage(p.getDamage());
              break;
View Full Code Here

Examples of battleTank.PlayerProjectile.collided()

          // that will cause any object somewhat near the exploded TNT to take damage
         
          if (obs instanceof TNT) {
            TNT c = (TNT) obs;
            if (c.getRectangle().intersects(p.getRectangle())) {
              p.collided();
              projectileList.remove(p);
              notifyObservers(new Point(c.getLocation().row - 12, c.getLocation().col - 12));
              setChanged();
              c.recieveDamage(p.getDamage());
              break;
View Full Code Here

Examples of battleTank.Point.collided()

        for (Item i : itemList) {
         
          if (i instanceof BubbleShield) {
            BubbleShield c = (BubbleShield) i;
            if (c.getRectangle().intersects(p.getRectangle())) {
              p.collided();
              projectileList.remove(p);
              itemList.remove(c);
              notifyObservers(new Point(p.getLocation().row - 12, p.getLocation().col - 12));
              setChanged();
              break;
View Full Code Here

Examples of battleTank.Point.collided()

            }
          }
          if (i instanceof IceBlock) {
            IceBlock c = (IceBlock) i;
            if (c.getRectangle().intersects(p.getRectangle())) {
              p.collided();
              projectileList.remove(p);
              itemList.remove(c);
              notifyObservers(new Point(c.getLocation().row - 12, c.getLocation().col - 12));
              setChanged();
              break;
View Full Code Here

Examples of battleTank.Point.collided()

            }
          }
          if (i instanceof SpeedBoost) {
            SpeedBoost c = (SpeedBoost) i;
            if (c.getRectangle().intersects(p.getRectangle())) {
              p.collided();
              projectileList.remove(p);
              itemList.remove(c);
              notifyObservers(new Point(p.getLocation().row - 12, p.getLocation().col - 12));
              setChanged();
              break;
View Full Code Here

Examples of battleTank.Point.collided()

       
        //Removes the EnemyTank if it is hit by the PlayerTank's projectile
       
        for (EnemyTank h : enemyList) {
          if (h.getRectangle().intersects(p.getRectangle())) {
            p.collided();
            projectileList.remove(p);
            h.recieveDamage(p.getDamage());
            notifyObservers(new Point(p.getLocation().row - 12, p.getLocation().col - 12));
            setChanged();
            break;
View Full Code Here

Examples of battleTank.Point.collided()

          // Crate's are destroyed when a projectile collides with them
         
          if (obs instanceof Crate) {
            Crate c = (Crate) obs;
            if (c.getRectangle().intersects(p.getRectangle())) {
              p.collided();
              projectileList.remove(p);
              c.recieveDamage(p.getDamage());
              notifyObservers(new Point(p.getLocation().row - 12, p.getLocation().col - 12));
              setChanged();
              break;
View Full Code Here

Examples of battleTank.Point.collided()

          // that will cause any object somewhat near the exploded TNT to take damage
         
          if (obs instanceof TNT) {
            TNT c = (TNT) obs;
            if (c.getRectangle().intersects(p.getRectangle())) {
              p.collided();
              projectileList.remove(p);
              c.recieveDamage(p.getDamage());
              notifyObservers(new Point(p.getLocation().row - 12, p.getLocation().col - 12));
              setChanged();
              break;
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.