user3897399
user3897399

Reputation: 77

sprite Kit moving an object - the recommended way

I am new to the sprite Kit and I see that there are 3 different ways of moving objects:

  1. position += velocity

  2. create a physics body and apply impulse

  3. use physicsBody.velocity property

can you please give some guidelines when to use each one of the ways? I am a bit confused, Thanks.

Upvotes: 1

Views: 76

Answers (1)

CodeSmile
CodeSmile

Reputation: 64477

  1. if you aren't using SKPhysicsBody for that node
  2. if you want the mass of the physics body to influence the resulting velocity
  3. if you want to set the body's velocity regardless of its mass

Upvotes: 2

Related Questions