Skip to content

Instantly share code, notes, and snippets.

@fiftytwo
Created June 14, 2015 23:13
Show Gist options
  • Save fiftytwo/6a3826da9480d0618fbc to your computer and use it in GitHub Desktop.
Save fiftytwo/6a3826da9480d0618fbc to your computer and use it in GitHub Desktop.
-(void) startWithTarget:(CCNode *)aTarget
{
[super startWithTarget:aTarget];
NSAssert([self.target isKindOfClass:[CCNode class]], @"Target is not CCNode");
startAngle_ = [(CCNode *)self.target rotation];
diffAngle_ = dstAngle_ - startAngle_;
}
-(void) update: (ccTime) t
{
NSAssert([self.target isKindOfClass:[CCNode class]], @"Target is not CCNode");
[(CCNode *)self.target setRotation: startAngle_ + diffAngle_ * t];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment