Examples of collided()


Examples of battleTank.EnemyProjectile.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(c.getLocation().row - 12, c.getLocation().col - 12));
              setChanged();
              break;
View Full Code Here

Examples of battleTank.EnemyProjectile.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.EnemyProjectile.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.EnemyProjectile.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.EnemyProjectile.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.EnemyProjectile.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.EnemyProjectile.collided()

          // ImmovableBlock's can not be destroyed. If a projectile collides with one, the projectile is removed.
         
          if (obs instanceof ImmovableBlock) {
            ImmovableBlock c = (ImmovableBlock) 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.EnemyProjectile.collided()

          //FireRing's can not be destroyed. If a projectile collides with one, the projectile is removed.
         
          if (obs instanceof FireRing) {
            FireRing c = (FireRing) 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.PlayerProjectile.collided()

          // ImmovableBlock's can not be destroyed. If a projectile collides with one, the projectile is removed.
         
          if (obs instanceof ImmovableBlock) {
            ImmovableBlock c = (ImmovableBlock) 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.PlayerProjectile.collided()

          //FireRing's can not be destroyed. If a projectile collides with one, the projectile is removed.
         
          if (obs instanceof FireRing) {
            FireRing c = (FireRing) 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.