4

Where is the better place to apply moving of the sprites with physics bodies in the Spritekit game?

I know that both methods are called once per frame, first update and then didSimulatePhysics just before rendering the view...What sholud be done in update method and what in didSimulatePhysics when we talking about Spritekit games ?

Whirlwind
  • 14,286
  • 11
  • 68
  • 157
  • 4
    it depends on what exactly you intend to do, ie applying physics forces should be in update, making decisions or corrections after physics update should be done in didSimulatePhysics – CodeSmile Nov 04 '14 at 08:46

1 Answers1

2

if you are looking for physics logic such as checking collision and contact on every update for example a one way platform endless running game where you have to check collision and contact with every running physics body at that case go for didSimulatePhysics if you are looking for just moving physics bodies with not contact and collision mask then both method are sutiable.

dragoneye
  • 703
  • 6
  • 14