How to create an autoreversing animation that loops forever in Sprite Kit?

Viewed 6838

I'm trying to do a simple automatically reversing animation.

SKAction *a = [SKAction moveToX:10 duration:0.5];
a = [SKAction repeatActionForever:a];
[car runAction:a];

But the action doesn't reverse. How do you get a similar autoreverse effect like with Core Animation?

3 Answers
Related