1

I am currently programming a game in XCode with Objective-C and Spritekit. I use the SKAction class to move spritekitnodes around, but when I for an example want my character to fire an arrow I can only make the arrow move at constant speed.

I know that SKSpriteNode.physicsBody and Impulse can be used to create gravity/acceleration. But I would prefer using the [SKAction moveTo] since the node moves to a specified CGPoint.

Does anyone know a working method for moving a SKSpriteNode at an accelerating speed to a target CGPoint?

Wain
  • 118,658
  • 15
  • 128
  • 151
Klas. S
  • 650
  • 9
  • 21
  • 1
    If I understand you well, maybe this could help a bit: http://stackoverflow.com/questions/19026895/how-to-apply-different-easing-effects-to-sprite-action , or this: http://stackoverflow.com/a/21764087/3402095 Also check SKAction timing modes https://developer.apple.com/library/prerelease/ios/documentation/SpriteKit/Reference/SKAction_Ref/index.html#//apple_ref/c/tdef/SKActionTimingMode – Whirlwind Mar 02 '15 at 02:06
  • 1
    Or you can animate speed property of a node : http://stackoverflow.com/a/20506599/3402095 – Whirlwind Mar 02 '15 at 02:11
  • Thank you, I used SKActionTimingEaseIn to add a little bit of acceleration. The other solutions you provided seem to have more customization but they are also harder to implement. – Klas. S Mar 04 '15 at 19:30

0 Answers0