object must push off another while each off them has a point as a magnet

i got a task to make one object bounce off another, but have no idea how to do the same, when at least one object should keep on point and another one “dethrone” him can you help me pls? i tried a lot of solutions with velocity, direction calculating and etc.

here is an example in gif format

9026107--1245388--ezgif.com-video-to-gif.gif

See which one is not at the dot, then increase the value of how much it is attracted to the dot?