Hello,
I'm wondering if someone could teach me how to find the farthest distance an object could be in a range of points. I know the formula for distance between points, but not sure how to find the two farhest away points from this range. The numbers are from the functions below.
Y = random(enemyUnit.Y - 80 , enemyUnit.Y + 80)
X = random(enemyUnit.X - 75, enemyUnit.X + 75)
These are two random points being set to X, Y.
After this is calculated I lerp towards X, Y point from current point. The last thing I do is test distance away from the new point and see if it's so many px away yet. This is what trips me up. The distance event doesn't fire every time, because I might be short. I need to know how to figure out ranges like this so being short can't happen.
How do you tell the farthest away these two points can be. This is really dumb, I know, lol.
To be honest I'm not even sure if this can be calculated, or if I have enough numbers. For a more visual look I'm messing with Construct. The events are below.