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); }
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); }