コード例 #1
0
ファイル: Item.java プロジェクト: TeamSweepy/Greywater
  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);
  }
コード例 #2
0
ファイル: Item.java プロジェクト: TeamSweepy/Greywater
  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);
  }