         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
+    func angleTo(lat1: Float64, lon1: Float64, lat2: Float64, lon2: Float64) -> Float64 {
+        let pi = 3.14159
+        var angle = atan2(lat2 - lat1, lon2 - lon1) * 180/pi
+        
+        if (angle < 0){
+            angle += 360
+        }
+        
+        return angle + 90;
+    }
+    
+    func withinRange(lat1: Float64, lon1: Float64, lat2: Float64, lon2: Float64) -> Bool {
+        let a = (lat2 - lat1)*(lat2 - lat1)
+        let b = (lon2 - lon1)*(lon2 - lon1)
+        let distance = sqrt(a + b)
+        
+        if (distance < self.shootRadius){
+            print(distance, self.shootRadius)
+        }
+        
+        if distance < self.shootRadius {
+            return true
+        } else {
+            return false
+        }
     }
 }

            let url = NSURL(string: apiURL)
            
            let task = NSURLSession.sharedSession().dataTaskWithURL(url!) {(data, response, error) in
                var enemies = [Enemy]()
                
                do {
                    let json = try NSJSONSerialization.JSONObjectWithData(data!, options: .AllowFragments)
                    

    
    override func viewDidLoad() {
        super.viewDidLoad()
        
//        AudioServicesPlayAlertSound(SystemSoundID(kSystemSoundID_Vibrate))
        
        let gunFireFile = NSBundle.mainBundle().URLForResource("fire", withExtension: "mp3")
        do {
