3

I Want to know the difference between the BezierBy and BezierTo. What will happen in the below code if say this is the scenario

     CCBezierConfig bezier = new CCBezierConfig();


     // Bezier curve  
     bezier.controlPoint_1 = CGPoint.make(1002.0f,475.0f);
     bezier.controlPoint_2 = CGPoint.make(454.0f, 281.0f);
     bezier.endPosition = CGPoint.make(-20.0f,490.0f);

     CCBezierBy by = CCBezierBy.action(100, bezier);
     CCBezierTo to = CCBezierTo.action(2, bezier);

     CCCallFuncN actionMoveDone = CCCallFuncN.action(this,"spriteMoveFinished");
     CCSequence actions = CCSequence.actions(by, actionMoveDone);

     obstacle1.runAction(actions);

Also have same issues in understand moveTo and moveBy

Please help me with the concepts.

user1169079
  • 3,053
  • 5
  • 42
  • 71

1 Answers1

5

CCMoveTo moves your node TO position. CCMoveBy moves your node for sone pixels. All ather actions are same. Example:

CCNode *a = [[CCNode alloc] init];
[a setPosition:CGPointMake(100, 100)]; //our node starts at point (100, 100)

now, if you'll move it TO CGPointMake(200,200), his positions will be (200, 200). But if you'll move it from (100, 100) BY CGPointMake(200,200), it will be (300, 300).

SentineL
  • 4,682
  • 5
  • 19
  • 38
  • THanks dude that is what I needed, its to and by ... by - relative to the last position whereas to is the moving to the respective position .. – user1169079 May 17 '12 at 09:12