views:

52

answers:

0

I have an object that moves with CCBezierTo.


  CCSprite * bedrumotic = [CCSprite spriteWithFile:@"9_bedrimotic.png"];
  [bedrumotic setPosition:ccp(100, 800)];
  [self addChild:bedrumotic z:4];

  ccBezierConfig bezier1;
  bezier1.controlPoint_1 = ccp(300, 950);
  bezier1.endPosition = ccp(500, 800);
  id move1 = [CCBezierTo actionWithDuration:1 bezier:bezier1];

  ccBezierConfig bezier2;
  bezier2.controlPoint_1 = ccp(400, 1000);
  bezier2.controlPoint_2 = ccp(500, 1000);
  bezier2.endPosition = ccp(700, 900);
  id move2 = [CCBezierTo actionWithDuration:1 bezier:bezier2];

  id move3 = [CCOrbitCamera actionWithDuration:0.01f radius:1 deltaRadius:0 angleZ:0.0 deltaAngleZ:180.0 angleX:0.0 deltaAngleX:0.0];

  ccBezierConfig bezier4;
  bezier4.controlPoint_1 = ccp(700, 800);
  bezier4.controlPoint_2 = ccp(600, 750);
  bezier4.endPosition = ccp(300, 500);
  id move4 = [CCBezierTo actionWithDuration:1 bezier:bezier4];

  ccBezierConfig bezier5;
  bezier5.controlPoint_1 = ccp(200, 850);
  bezier5.controlPoint_2 = ccp(400, 650);
  bezier5.endPosition = ccp(100, 800);
  id move5 = [CCBezierTo actionWithDuration:1 bezier:bezier5];

  id move6 = [CCOrbitCamera actionWithDuration:0.01f radius:1 deltaRadius:0 angleZ:0.0 deltaAngleZ:0.0 angleX:0.0 deltaAngleX:0.0];

  ccBezierConfig bezier7;
  bezier7.controlPoint_1 = ccp(100, 450);
  bezier7.controlPoint_2 = ccp(500, 550);
  bezier7.endPosition = ccp(600, 400);
  id move7 = [CCBezierTo actionWithDuration:1 bezier:bezier7];

  ccBezierConfig bezier8;
  bezier8.controlPoint_1 = ccp(700, 500);
  bezier8.controlPoint_2 = ccp(700, 650);
  bezier8.endPosition = ccp(700, 800);
  id move8 = [CCBezierTo actionWithDuration:1 bezier:bezier8];

  id move9 = [CCOrbitCamera actionWithDuration:0.01f radius:1 deltaRadius:0 angleZ:0.0 deltaAngleZ:180.0 angleX:0.0 deltaAngleX:0.0];
  id move10 = [CCJumpTo actionWithDuration:1 position:ccp(100, 800) height:50 jumps:3];
  id move11 = [CCOrbitCamera actionWithDuration:0.01f radius:1 deltaRadius:0 angleZ:0.0 deltaAngleZ:0.0 angleX:0.0 deltaAngleX:0.0];

  [bedrumotic runAction:[CCRepeatForever actionWithAction:[CCSequence actions:move1, move2, move3, move4, move5, move6, move7, move8,move9,move10,move11, nil]]];

Everything is in order when I start the action once. If I runAction with CCRepeatForever the object flies off the screen. Where I was wrong?