Package org.samcrow.environment

Examples of org.samcrow.environment.RectangleObstacle


  /**
   * Add obstacles around the edges of the screen.
   */
  private void addEdgeObstacles() {
    final int width = 30;//edge obstacle width
    obstacles.add(new RectangleObstacle(0 - width, 0 - width, width, HEIGHT + width * 2));//left side
    obstacles.add(new RectangleObstacle(WIDTH, 0 - width, width, HEIGHT + width * 2));//right side
    obstacles.add(new RectangleObstacle(0, 0 - width, WIDTH, width));//top
    obstacles.add(new RectangleObstacle(0, HEIGHT, WIDTH, width));//bottom
  }
View Full Code Here


    }
    default: {
      // add rectangle obstacle
      queue.clearDragging();
      // add rectangle obstacle
      RectangleObstacle obstacle = new RectangleObstacle(
          (int) Math.round(dragStart.getX()),
          (int) Math.round(dragStart.getY()), (int) Math.round(e
              .getX() - dragStart.getX()), (int) Math.round(e
              .getY() - dragStart.getY()));
      queue.addPersistent(obstacle.drawObject());
      obstacles.add(obstacle);
      break;
    }
    }
  }
View Full Code Here

      break;
    }
    default: {
      queue.clearDragging();
      // add rectangle obstacle
      RectangleObstacle obstacle = new RectangleObstacle(
          (int) Math.round(dragStart.getX()),
          (int) Math.round(dragStart.getY()), (int) Math.round(e
              .getX() - dragStart.getX()), (int) Math.round(e
              .getY() - dragStart.getY()));
      queue.addDragging(obstacle.disabledDrawObjects());
      break;
    }
    }
  }
View Full Code Here

TOP

Related Classes of org.samcrow.environment.RectangleObstacle

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.