I've looked at similar questions here but I can't make the examples work for me. Since the way I'm creating this path is a bit different than previous examples, I'll state my problem:
I'm trying to visualize a path that sprites are made to follow in a SpriteKit game.
I call this in another method, where I add the shipPath
to a SKAction
CGPathRef shipPath = [self buildEnemyShipMovementPath:enemy];
SKAction *followPath = [SKAction followPath:shipPath
asOffset:YES
orientToPath:YES
duration:7];
The path creation method:
- (CGPathRef)buildEnemyShipMovementPath:(SKSpriteNode*)enemy
{
UIBezierPath* bezierPath = [UIBezierPath bezierPath];
// ... path creation code ... //
return bezierPath.CGPath;
}
Given this, what should I do to "see" the path on screen, potentially I'd like to toggle it on and off, for debugging purposes.