                     return
                 }
                 
-//                print(data!.rotationRate.y)
-                
                 if data!.rotationRate.y < -15{
                     self.gunReload.play()
                     print("RELOAD")

        print("Errors: " + error.localizedDescription)
    }
    
    func setupAudioPlayerWithFile(file:NSString, type:NSString) -> AVAudioPlayer?  {
        //1
        let path = NSBundle.mainBundle().pathForResource(file as String, ofType: type as String)
        let url = NSURL.fileURLWithPath(path!)
        
        //2
        var audioPlayer:AVAudioPlayer?
        
        // 3
        do {
            try audioPlayer = AVAudioPlayer(contentsOfURL: url)
        } catch {
            print("Player not available")
        }
        
        return audioPlayer
    }
}

class MapViewController: UIViewController, MKMapViewDelegate, CLLocationManagerDelegate {
    @IBOutlet weak var mapView: MKMapView!
 
    var enemies = [Enemy]()
    
    let enemyRadius = 2 // Kilometers
    let shootRadius = 0.004 // Kilometers (about 100 feet)
    
    var enemiesLoaded = false

    var userLatitude = 0.0
    var userLongitude = 0.0
    
    var ammo = 6
    var canShoot = true
    var canShootTimer = NSTimer()
