title: Moving a "falling" CCSprite according to acceleration
body: <p>I am using this code to move a "falling" sprite according to the acceleration of the UIDevice.
  It works nice, but is very laggy, meaning that there are jumps between the positions of the sprite.</p>
  
  <pre><code>- (void)accelerometer:(UIAccelerometer *)accelerometer didAccelerate:(UIAcceleration *)acceleration {
      if(paused)
          return;
      directionPoint.x += acceleration.x * 100;
  }
  - (void)update:(ccTime)dt {
      if(paused)
          return;
      directionPoint.y = -500*dt;
      CGPoint playerDestinationPoint = player.position;
      playerDestinationPoint.x += directionPoint.x;
      playerDestinationPoint.y += directionPoint.y;
      if(playerDestinationPoint.x &lt; player.contentSize.width/2) {
          playerDestinationPoint.x = player.contentSize.width/2;
      }
      else if(playerDestinationPoint.x &gt; ([[CCDirector sharedDirector] winSize].width - play    er.contentSize.width/2)) {    
          playerDestinationPoint.x = [[CCDirector sharedDirector] winSize].width - player.contentSize.width/2;
      }
      [player setPosition:playerDestinationPoint];
  
      directionPoint = CGPointMake(0.0, 0.0);
  }
  </code></pre>
  
  <p>I tried to use CCMoveTo this way:</p>
  
  <pre><code>- (void)update:(ccTime)dt {
      if(paused)
      return;
      [player stopAllActions];
      directionPoint.y = -500*dt;
      CGPoint playerDestinationPoint = player.position;
      playerDestinationPoint.x += directionPoint.x;
      playerDestinationPoint.y += directionPoint.y;
      if(playerDestinationPoint.x &lt; player.contentSize.width/2) {
          playerDestinationPoint.x = player.contentSize.width/2;
      }
      else if(playerDestinationPoint.x &gt; ([[CCDirector sharedDirector] winSize].width - player.contentSize.width/2)) {
          playerDestinationPoint.x = [[CCDirector sharedDirector] winSize].width - player.contentSize.width/2;
      }
      id actionMoveTo = [CCMoveTo actionWithDuration:dt position:playerDestinationPoint];
      [player runAction:actionMoveTo];
  
      directionPoint = CGPointMake(0.0, 0.0);
  }
  </code></pre>
  
  <p>but the sprite won't move at all. Any hints?</p>
  
  <p>MfG,</p>
  
  <p>SideSwipe</p>