public void drawCircle(int xPos, int yPos, int radius, int id) {

    // c.setLocation(xPos, yPos);
    c.setCenterX(xPos);
    c.setCenterY(yPos);
    c.setRadius(radius);

    drawableMap.updateBlocks(c, id);
  }
예제 #2
0
  @Override
  public void update(Level level, GameContainer arg0) {
    if (shownFor >= 50) {
      shownFor = 0;
      if (pos != colors.length - 1) {
        pos++;
      } else {
        pos = 0;
      }
    }
    if (AOE) {
      if (AOEShape == null) {
        AOERadius = 4.0f;
        AOEShape =
            new Circle(this.getShape().getCenterX(), this.getShape().getCenterY(), AOERadius);

      } else {
        AOERadius += 4f;
        AOEShape.setRadius(AOERadius);
        AOEShape.setCenterX(this.getShape().getCenterX());
        AOEShape.setCenterY(this.getShape().getCenterY());
      }

      if (AOERadius >= 300) {
        AOE = false;
        AOEShape = null;
        AOERadius = 0.0f;
      }

      for (Entity e : level.entitys) {
        if (AOEShape == null) break;
        if (e.getShape().intersects(AOEShape)) {
          e.die(level);
        }
      }
    }
  }