Created
June 14, 2015 23:13
-
-
Save fiftytwo/6a3826da9480d0618fbc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-(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