Package rectangles

Examples of rectangles.BlastRadiusRectangle


   */
  public void recieveDamage(int dmg) {
    health = health - dmg;
    if (this.removeObstacle()) {
      rect = new TNTRectangle(-100, -100);// removing off field
      BlastRadiusRectangle b = new BlastRadiusRectangle(location.col - 50, location.row - 50);
      LinkedList<Obstacle> obs = map.getObstacles();
      LinkedList<PlayerTank> tank = map.getPlayers();
      LinkedList<EnemyTank> enemies = map.getEnemies();
      for(int i = 0; i < obs.size(); i++) {
        Obstacle o = obs.get(i);
        if(o instanceof Crate) {
          Crate c = (Crate)o;
          if(b.intersects(c.getRectangle())) {
            notifyObservers(new Point(c.getLocation().row - 12, c.getLocation().col - 12));
            setChanged();
            c.recieveDamage(1);
            i = 0;
          }
View Full Code Here


   */
  public void recieveDamage(int dmg) {
    health = health - dmg;
    if (this.removeObstacle()) {
      rect = new TNTRectangle(-100, -100);// removing off field
      BlastRadiusRectangle b = new BlastRadiusRectangle(location.col - 50, location.row - 50);
      LinkedList<Obstacle> obs = map.getObstacles();
      LinkedList<PlayerTank> tank = map.getPlayers();
      LinkedList<EnemyTank> enemies = map.getEnemies();
      for(int i = 0; i < obs.size(); i++) {
        Obstacle o = obs.get(i);
        if(o instanceof Crate) {
          Crate c = (Crate)o;
          if(b.intersects(c.getRectangle())) {
            notifyObservers(new Point(c.getLocation().row - 12, c.getLocation().col - 12));
            setChanged();
            c.recieveDamage(1);
            i = 0;
          }
View Full Code Here

TOP

Related Classes of rectangles.BlastRadiusRectangle

Copyright © 2018 www.massapicom. 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.