title: Any way to speed up gameplay gradually in Swift?
body: <p>I'm currently working on a game using Spritekit. The game has objects which spawn at the top of the screen and fall towards the player character, and the game ends when the player character collides with any of the objects. I am trying to find a way to gradually speed up gameplay over time to make the game more difficult (i.e. objects fall at normal speed when the game begins, after 5 seconds speed up 50%, after 5 more seconds speed up another 50%, ad infinitum.) </p>
  
  <p>Would I need to use NSTimer to make a countdown to increase the gravity applied to the falling objects? Sorry if this is a basic thing, I'm kind of new to programming.</p>
  
  <p>Thanks, Jake</p>
  
  <p>EDIT:</p>
  
  <p>My spawn method for enemies-</p>
  
  <pre><code>let spawn = SKAction.runBlock({() in self.spawnEnemy()})
  let delay = SKAction.waitForDuration(NSTimeInterval(2.0))
  let spawnThenDelay = SKAction.sequence([spawn, delay])
  let spawnThenDelayForever = SKAction.repeatActionForever(spawnThenDelay)
  self.runAction(spawnThenDelayForever)
  </code></pre>
  
  <p>And my method for making the enemies fall-</p>
  
  <pre><code>func spawnEnemy() {
      let enemy = SKNode()
      let x = arc4random()
      fallSprite.physicsBody = SKPhysicsBody(rectangleOfSize: fallSprite.size)
      fallSprite.physicsBody.dynamic = true
      self.physicsWorld.gravity = CGVectorMake(0.0, -0.50)
      enemy.addChild(fallSprite)
  }
  </code></pre>