I have this piece of code,
@implementation Game
- (id)initWithWidth:(float)width height:(float)height
{
if ((self = [super initWithWidth:width height:height]))
{
SPQuad *mySprite = [[SPQuad alloc] initWithWidth:25 height:25];
mySprite.color = 0xff00ff;
[self addChild:mySprite];
SXMotionTweenPath *path = [SXMotionTweenPath path];
[path startPoint: [SPPoint pointWithX: 160 y: -25]];
[path addCurveToPoint:[SPPoint pointWithX: 160 y: 505] controlPoints:[SPPoint pointWithX: 50 y: 50] and:[SPPoint pointWithX: 300 y: 350] duration:10.0];
SXMotionTween *tween = [SXMotionTween tweenWithTarget: mySprite andPath: path];
[self.juggler addObject:tween];
[mySprite release];
}
return self;
}
@end
This code works and is located in Game.m (the main stage). I have this second code snippet.
SXMotionTweenPath *path = [SXMotionTweenPath path];
[path startPoint: [SPPoint pointWithX: 160 y: -25]];
[path addCurveToPoint:[SPPoint pointWithX: 160 y: 505] controlPoints:[SPPoint pointWithX: 50 y: 50] and:[SPPoint pointWithX: 300 y: 350] duration:10.0];
SXMotionTween *tween = [SXMotionTween tweenWithTarget: self andPath: path];
[self.stage.juggler addObject:tween];
Which is located inside of an init method of a subclassing of a SPSprite. This doesn't seem to work although it throughs no errors. I am not able to find the stage or juggler vars in the trace of the debugger so I am kinda lost. Both pieces of code have the correct includes and normal SPTweens are working in both as well.
Thanks in advance for any thoughts!
Andrew