title: iOS SpriteKit overlapping SKSpriteNodes / images
body: <p>I am a beginner and putting together a SpriteKit game in Swift, iOS Xcode. GameViewController passes the value <strong>name: String</strong> to GameScene. GameScene updates two images/SKSpriteNodes named <strong>apple.png</strong> and <strong>orange.png</strong>. The two images/SKSpriteNodes take approx the same position so they should not overlapp. But after several updates they are all overlapped. I have a vague idea that I am creating too many instances and not actually <em>updating</em> but unfortunately this is the end of my knowledge.</p>
  
  <p>How do I stop images overlapping at every update? Thank you for helping.</p>
  
  <pre><code>func updateName(name: String) {  // name:String is passed from gameViewController
   var XYZ = SKSpriteNode(imageNamed: "\(name).png")
   if (name == "apple") {
       XYZ.anchorPoint = CGPointMake(...)
       XYZ.position = CGPoint(...)
       XYZ.setScale(...)
       self.addChild(XYZ)
       // animation of apple
   } else if (name == "orange") {
       XYZ.anchorPoint = CGPointMake(another set of ...)
       XYZ.position = CGPoint(another set of ...)
       XYZ.setScale(snother set of ...)
       self.addChild(XYZ)
       // animation of orange
   }
  }
  </code></pre>