So for my start menu, I'm trying to create a button that vibrates more as the mouse gets closer to the center. My current programming for this is as follows:
X=124+random(-(Mouse.X-160), (Mouse.X-160))
Y=78+random(-(Mouse.Y-90), (Mouse.Y-90))
If you can't make out what all this gibberish means, its purpose is to
Set X to (the button's position) +/- a random number that gets exponentially bigger as the mouse gets closer
Set Y to (the button's position) +/- a random number that gets exponentially bigger as the mouse gets closer
This programming works fine, except the effect I want is inverted. Currently, the button vibrates more as the mouse gets further away, and less as it gets closer, which is the opposite of what I want.
___________________________
UPDATE:
I've sort of fixed the problem by getting the reciprocal of the increments, giving
X = 124+1/(random(-(Mouse.X-160), (Mouse.X-160)))
Y = 78+1/(random(-(Mouse.Y-90), (Mouse.Y-90)))
This does however create a weird glitch where the button moves to really far positions along the axes, so I now need help in fixing that.