title: table top gaming: how make character walk from one house to another, passing through every house in between?
body: <p>I just start to learn coding with Swift last month. This is my second personal project.
  I'm creating a table top game like "Monopoly" or something. Here an image of my prototype:<a href="http://i.stack.imgur.com/FAKGT.png" rel="nofollow">my table top board game</a></p>
  
  <p>I'm using a arc4random for the dices and moving the character/player with this code:</p>
  
  <pre><code>if positionPlayer1 == 1 {
          let time = dispatch_time(dispatch_time_t(DISPATCH_TIME_NOW), 1 * Int64(NSEC_PER_SEC))
          dispatch_after(time, dispatch_get_main_queue()) {
          player1.runAction(SKAction.moveByX(-66, y: 0, duration: 1))
          }
  
      } else if positionPlayer1 == 2 {
          let time = dispatch_time(dispatch_time_t(DISPATCH_TIME_NOW), 1 * Int64(NSEC_PER_SEC))
          dispatch_after(time, dispatch_get_main_queue()) {
          player1.runAction(SKAction.moveByX(-44, y: 0, duration: 1))
          }
  </code></pre>
  
  <p>I also tried :</p>
  
  <pre><code>player1.runAction(SKAction.moveByX(-66, y: 0, duration: 1))
          sleep(1)
  </code></pre>
  
  <p>The problem is: the character waits the total time e runs directly to the final position. Let's say the dice give an 6, the character waits for 6 seconds and runs to the last position. This is not a problem on a straight line, but if the movement pass through a corner, the character cuts in diagonal directly to the final position instead of pass through every house as intended.
  Any help will be appreciated.</p>
  
  <p>Edit: I decided to try physics. I created a lot of SKSpriteNode "walls". To all nodes I'm using:</p>
  
  <pre><code>squareBlock02.physicsBody?.allowsRotation = false
      squareBlock02.physicsBody?.pinned = true
      squareBlock02.physicsBody?.dynamic = false
  </code></pre>
  
  <p>The result is that the player hits those walls and move them. I tried mass, density... nothing prevents the player from push all walls from its way.</p>