Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Sure you can do this using :</p> <pre><code> ccBezierConfig bezier; bezier.controlPoint_1 = ccp(320,0); // control point 1 bezier.controlPoint_2 =ccp(0,0); // control point 2 bezier.endPosition = ccp(endPoint.x,endPoint.y) ; id bezierForward = [CCBezierTo actionWithDuration:3 bezier:bezier]; [ball runAction:bezierForward]; </code></pre> <p>you can use ccBezier to move any node in curves :</p> <p>Now Animation Part :</p> <pre><code> [[CCSpriteFrameCache sharedSpriteFrameCache] addSpriteFramesWithFile:@"eggAnimation.plist"]; spriteSheet = [CCSpriteBatchNode batchNodeWithFile:@"eggAnimation.png"]; [gameBackgroundLayer addChild:spriteSheet]; eggAnimFrames = [NSMutableArray array]; for ( int i = 1; i &lt;= 10; i++ ) { [eggAnimFrames addObject:[[CCSpriteFrameCache sharedSpriteFrameCache] spriteFrameByName:[NSString stringWithFormat:@"%d.png", i]]]; } rotateAnim = [CCAnimation animationWithFrames:eggAnimFrames delay:0.05f]; ball = [CCSprite spriteWithSpriteFrameName:@"1.png"]; ball.position=ccp(160,80); rotateAction =[CCRepeatForever actionWithAction:[CCAnimate actionWithAnimation:rotateAnim restoreOriginalFrame:YES]]; [spriteSheet addChild:ball]; </code></pre> <p>Reference Links : <a href="http://www.raywenderlich.com/1271/how-to-use-animations-and-sprite-sheets-in-cocos2d" rel="nofollow">http://www.raywenderlich.com/1271/how-to-use-animations-and-sprite-sheets-in-cocos2d</a></p> <p><a href="http://www.math.ubc.ca/~cass/gfx/bezier.html" rel="nofollow">http://www.math.ubc.ca/~cass/gfx/bezier.html</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload