0

Good afternoon, everybody!

I am creating space game which has an effect similar to black hole's gravitational effect. Wherever the spaceship is going, the black hole will attract it, summing up all the vectors together.

I know SKFieldNode has a method customFieldWithEvaluationBlock: that allows to calculate everything myself, but might it be another way to do that?

I have tried almost every type in SKFieldNode, but nothing helped.

  1. There are some side effects that don't suit me (i.e. If I use an electric or magnetic field, the object repels from the black hole)
  2. Moreover, moving with SKAction (i.e. for the spaceship) doesn't allow me to sum all movement vectors together (I cant do - (void)moveTo:duration: actions simultaneously, even with grouping the actions)

What can you advice me? Thank you in advance!

Beraliv
  • 518
  • 7
  • 20
  • Did you try the [radial gravity field](https://developer.apple.com/library/prerelease/ios/documentation/SpriteKit/Reference/SKFieldNode_Ref/index.html#//apple_ref/occ/clm/SKFieldNode/radialGravityField)? :) – ABakerSmith Sep 10 '15 at 19:26
  • 1
    This may be what you're looking for http://stackoverflow.com/questions/31500104/simulate-universal-gravitation-for-two-sprite-kit-nodes – 0x141E Sep 10 '15 at 19:45
  • @0x141E yeah, but there are specific calculations that need to be done (but its helpful anyway, thanks a lot) – Beraliv Sep 10 '15 at 19:59

0 Answers0