Hi!
I know this might sound very stupid but I've been struggling with this issue for a couple of days and I know there must be something that I'm missing.
I'm building a game where there is only 4 ways a character can move (right/left/up/down). In each direction there is an animation of images for the character and then there is the animation of the movement of the character itself.
My issue is that once I run the animation to walk left for example it starts and then I can't access this animation in the middle to change it to walk up when the character starts to move up. So what I end up with is a character that moves left normally then moonwalks up.
The animation code I'm using is as follows:
//person is an AtlasSprite
//walkLeft is the image animation of walking left
//movement1 is the movement to the left
//movement2 is the next movement be it up or down I haven't implemented that yet.
- (void)moveToLeft:(CGPoint)destination {
id animation = [Animate actionWithAnimation: walkLeft restoreOriginalFrame:YES];
animation = [RepeatForever actionWithAction:animation];
id movement1 = [MoveTo actionWithDuration:2 position:ccp(person.position.x, destination.y)];
id movement2 = [MoveTo actionWithDuration:2 position:destination];
id movement = [Sequence actions:movement1, movement2, nil];
[person runAction:animation];
[person runAction:movement];
}
Thanks a lot