title: Add / Remove SKSpriteNode in different function
body: <p>I am newish to swift and can't seem to grasp this concept:
  I need to create an SKSpriteNode in one function, then removed it in another and I can't quite get how to code it so that the removing function has access to the element created in another function. The situation: A power up node is created and displayed on the screen. The hero collects the power up and an icon is added to the bottom of the screen. The player can then touch the power up icon to use it, and then the icon should be removed from the screen.
  I'll try to illustrate what I mean in the code below.</p>
  
  <pre><code>func createPowerUp() {
      var powerUpNode = SKSpriteNode("...")//add node to screen for player to collect
      addChild(powerUpNode)
  }
  
  func playerCollectsPowerUp() {
      let powerUpIcon = SKSpriteNode("...")//add icon to bottom of screen
      addChild(powerUpIcon)
  }
  
  func usePowerUp() {
      powerUpIcon.removeFromParent()//This is my error, powerUpIcon is not defined
  
  func touchesEnded() {
      usePowerUp()
  }
  </code></pre>
  
  <p>So, how do I structure this so that usePowerUp() has access to the SKSpriteNode I created in playerCollectsPowerUp() ? I know I could define the SKSpriteNode on a higher level and that would give both methods access to the power up icon. But is that a good practice?</p>