xcode 5 iOS7 sprite kit.
My wish is to make a sprite that has its own gravity. Like a planet. If another sprite comes within a certain range of it, it will slowly pull the other sprite closer.
I have two sprites. One moving and one stationary. When the moving sprite gets in a given distance of the stationary sprite the stationary sprite gravity should slowly pull the other sprite towards it. This way the moving sprite would change its path in a soft curve.
My idea would be to calculate the distance from the stationary object to any other object and if close enough start pulling and if the moving object gets out of range ageing, then stop pulling. Would probably need to research some vector calculation. Thats my immediate thoughts.
Is this possible and how? Does it already exist?