title: Manually move node over a period of time
body: <p>I currently have the following functions declared which moves a node to a target location which is called in the update function of the scene (In this situation, I <em>can't</em> use SKAction.moveTo)</p>
  
  <pre><code>func moveTowardsPosition(targetPosition: CGPoint, withTimeInterval timeInterval: NSTimeInterval) {
      let currentPosition = self.position
      var deltaX = targetPosition.x - currentPosition.x
      var deltaY = targetPosition.y - currentPosition.y
      var maximumDistance = 3 * CGFloat(timeInterval)
      moveFromCurrentPosition(currentPosition, byDeltaX: deltaX, deltaY: deltaY, maximumDistance: maximumDistance)
  }
  
  func moveFromCurrentPosition(currentPosition: CGPoint, byDeltaX dx: CGFloat, deltaY dy: CGFloat, maximumDistance: CGFloat) {
      let targetPosition = CGPointMake(currentPosition.x + dx, currentPosition.y + dy)
      var distRemaining = hypot(dx, dy)
      if distRemaining &lt; maximumDistance {
          position = targetPosition
      } else {
          let x = currentPosition.x * maximumDistance
          let y = currentPosition.y * maximumDistance
          position = CGPointMake(x, y)
      }
  }
  </code></pre>
  
  <p>(These are slightly modified from Apples "Adventure" game)</p>
  
  <p>My problem is these lines in the <em>moveCurrentPosition</em> function.</p>
  
  <pre><code>let x = currentPosition.x * maximumDistance
  let y = currentPosition.y * maximumDistance
  position = CGPointMake(x, y)
  </code></pre>
  
  <p>Basically, I have no idea what values to set x and y to so that position represents the correct position.
  In Apple's example, they are multiplying it by maximumDistance - angle. The angle var is a value that just affects the assets rotation, however my asset is 'static' and doesn't have multiple positions -- just 1.</p>
  
  <p>With that in mind, what would I set <em>x</em> and <em>y</em> to so they are representative of the correct position?</p>
  
  <p>(You can see Apple's example here: <a href="https://developer.apple.com/library/prerelease/ios/samplecode/Adventure-Swift/Listings/Swift_Adventure_Adventure_Shared_Sprites_Character_swift.html" rel="nofollow">https://developer.apple.com/library/prerelease/ios/samplecode/Adventure-Swift/Listings/Swift_Adventure_Adventure_Shared_Sprites_Character_swift.html</a>) </p>