I am trying to get a bunch of objects to interact with eachother in such a way that a collection of objects will be repelled from a user controlled object. each individual object should be repelled along the slope between itself and the user object, using the objects centers to determine the slope. The speed at which the object is repelled should be a constant, regardless of the slope.
each object has
float xspeed
float yspeed
float addedxspeed
float addedyspeed
xspeed and yspeed are constant for the lifetime of an object but the added speeds can be changed and are acted upon by a friction constant.
the coordinate plane that I am working with starts with x=0 growing left to right and y=0 growing top to bottom.
I would like to know how to calculate what my addedspeeds should be in order to make the object travel away from the user at a set speed, lets say 3.
if it helps at all to know my objects represent fish and the user is trying to eat them, the fish get scared, and swim away from the user…
Thanks for your help, if any more information is needed I will gladly repost…