so here is my code :
CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"path"];
animation.duration = 2.0;
animation.repeatCount = HUGE_VALF;
animation.autoreverses = YES;
animation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
animation.fromValue = (id)boxPath;
animation.toValue = (id)roundPath;
[shapeLayer addAnimation:animation forKey:@"animatePath"];
`
I use this code in a UIKIT app but now I would like to use it on cocos2D, is there a way to do it ? please 🙂 sorry for my english I’m french :/
Do you want to move one sprite to one location and back to place where you start???
If you want to do that this is some code :