I have a CGMuatbleCGPathRef and I am trying to create a path ref to move my alien. I'm keeping it simple right now, but these will be complex later on.
I have the code below to move the SpriteNode to one point, but he never moves. Can someone point out what i'm doing wrong? I have an animation action running on him with repeat action also.
Method called first to start the animation texture frames ( works )
-(void)walkingBear
{
//This is our general runAction method to make our bear walk.
[spaceMosquito runAction:[SKAction repeatActionForever:
[SKAction animateWithTextures:moqFrames
timePerFrame:0.4f
resize:NO
restore:YES]] withKey:@"walkingInPlaceBear"];
return;
}
The Action to move the alien
-(void) normalStance {
CGMutablePathRef cgpath = CGPathCreateMutable();
CGPoint endPos = CGPointMake(300, 600);
CGPoint startPos = CGPointMake(700, 900);
CGPathMoveToPoint(cgpath, nil, startPos.x, startPos.y);
CGPathMoveToPoint(cgpath, nil, endPos.x, endPos.y);
[spaceMosquito runAction:[SKAction followPath:cgpath duration:5.0f ] withKey:@"moveme"];
CGPathRelease(cgpath);
}