title: Using a random point in two actions
body: <p>Sorry I'm new to this.
  Right now I'm trying to create an endless randomly moving sprite that rotates to its direction. However I can't figure out how to use the random location generated from randomPoint on the rotateAction. Basically the bug randomly rotates instead of using the point it's going to. Is there a way I can use the same random point twice?</p>
  
  <pre><code>-(void)moveRandom:(CCSprite*)roach
  {
  
      CGPoint randomPoint = ccp(arc4random()%480, arc4random()%320);
      NSLog(@"%@", NSStringFromCGPoint(randomPoint));
  
      int minDuration = 2.0;
      int maxDuration = 4.0;
      int rangeDuration = maxDuration - minDuration;
      int randomDuration = (arc4random() % rangeDuration) + minDuration;
  
      float dY = roach.position.y - randomPoint.y;
      float dX = roach.position.x - randomPoint.x;
      float offset = dX&lt;0 ? 90.0f : -90.0f;
      float angle = CC_RADIANS_TO_DEGREES(atan2f(dY, dX)) + offset;
  
      [roach runAction:
       [CCActionSequence actions:
        [CCActionRotateTo actionWithDuration:0.001 angle:angle],
        [CCActionMoveTo actionWithDuration:randomDuration position: randomPoint],
        [CCActionCallBlock actionWithBlock:^{
           [self performSelector:@selector(moveRandom:) withObject:roach afterDelay:0.5];
       }],
        nil]
       ];
  </code></pre>