Example #1
0
  public void throwOnGround(Point2F destination, Mob thrower) {
    dropped = true;
    landingLoc = destination;
    startLoc = thrower.getLocation();
    physicsComponent.setLocation(startLoc.x, startLoc.y);
    thrower.getLevel().addNewFloorItem(this);

    angle = startLoc.angle(landingLoc);
    x = y = z = 0;
    maxDistance = startLoc.distance(landingLoc);
  }
Example #2
0
  public void throwItemAtTarget(Mob thrower, Entity target) {
    thrown = true;
    landingLoc = target.getLocation();
    startLoc = thrower.getLocation();
    physicsComponent.setLocation(startLoc.x, startLoc.y);

    thrower.getLevel().addNewThrownItem(this);

    angle = startLoc.angle(landingLoc);
    x = y = z = 0;
    maxDistance = startLoc.distance(landingLoc);
  }