 ; Actions
 ; ----------------------------------------------------------------------
 
-(defn shoot [{:keys [shooting? shots millis-since-last-shot] :as ship}]
+(defn shoot [{:keys [shooting? shots millis-since-last-shot firing?] :as ship}]
   (let [millis-since-last-shot (+ turn-millis millis-since-last-shot)
         shoots? (and shooting? (>= millis-since-last-shot shot-millis))
-        shots (if shoots? (conj shots (create-shot ship)) shots)]
-    (when shoots? (play-sound "shot"))
-    (assoc ship :millis-since-last-shot (if shoots? 0 millis-since-last-shot)
+        shots (if shoots? (conj shots (create-shot ship)) shots)
+        fires? (and firing? (>= millis-since-last-shot shot-millis))
+        shots (if fires? (conj shots (create-missile ship)) shots)]
+    (when (or shoots? fires?) (play-sound "shot"))
+    (assoc ship :millis-since-last-shot (if (or shoots? fires?) 0 millis-since-last-shot)
                 :shots shots)))
 
 (defn basic-move

(defmethod move :shot [shot]
  (basic-move shot false))

(defmethod move :asteroid [asteroid]
  (basic-move asteroid))


(def ship-rotation-speed 4)
(def shot-size (/ ship-size 10))
(def shot-speed 2.5)
(def shot-millis 300)
(def missile-size (/ ship-size 3))
(def missile-speed 1)
(def missile-acceleration 1)
(def missile-millis 10000)
(def asteroids-start-number 1)
(def asteroid-start-size 5)
(def asteroid-min-size 1.2)
(def asteroid-size-variance 0.2)
(def asteroid-jaggedness 0.7)
(def asteroid-max-speed 0.6)
(def asteroid-max-rotation-speed 4)
(def fragment-number 3)
(def crit-fragment-number 30)
(def fragment-size-reduction (Math/sqrt fragment-number))
(def crit-fragment-size-reduction (Math/sqrt crit-fragment-number))
(def debris-life-millis 3000)
(def turn-millis 40)

