title: Random movements / turbulences - SWIFT
body: <p>I'm developing a game on Iphone and Ipad like a space invaders. </p>
  
  <p>Balloons to destroy are falling from the top of the screen in a straight line.</p>
  
  <p>Here my codes to add them : </p>
  
  <pre><code>func addBalloonv(){
  
  
      var balloonv:SKSpriteNode = SKSpriteNode (imageNamed: "ballonvert.png")
  
  
      balloonv.physicsBody = SKPhysicsBody (circleOfRadius: balloonv.size.width/2)
      balloonv.physicsBody.dynamic = true
      balloonv.physicsBody.categoryBitMask = balloonCategory | greenCategory
      balloonv.physicsBody.contactTestBitMask = flechetteCategory
      balloonv.physicsBody.collisionBitMask = balloonCategory
      balloonv.physicsBody.mass = 1
      balloonv.physicsBody.restitution = 1
      balloonv.physicsBody.allowsRotation = true
  
  
      let minX = balloonv.size.width/2
      let maxX = self.frame.size.width - balloonv.size.width/2
      let rangeX = maxX - minX
      let position:CGFloat = CGFloat(arc4random()) % CGFloat(rangeX) + CGFloat(minX)
  
      balloonv.position = CGPointMake(position, self.frame.size.height+balloonv.size.height)
  
      self.addChild(balloonv)
  </code></pre>
  
  <p>I have one func by balloon color.</p>
  
  <p>So for the moment they move in straight line and I'm looking for random movements (with turbulences like balloon in air) from the top and both sides. </p>
  
  <p>How can I do that?  </p>
  
  <p>Thank you very much !!</p>