               (int \J) {:fire-weapon :launcher}
               (int \K) {:fire-weapon :machinegun}})
 
-; END: constants
-
 (def sqrt (memoize #(Math/sqrt %)))
-
-(defn random [from to]
-  (let [range (- to from)]
-    (+ from (rand range))))
-
-(defn vary [variance n]
-  (let [from (* n (- 1 variance))
-        to (* n (+ 1 variance))]
-    (random from to)))
 
 (defn get-transformation-matrix [{:keys [size position direction]} scale]
   (let [[x y] position]

  (basic-move asteroid))

(defmethod move :debris [{:keys [life-time size] :as debris}]
  (if (<= life-time 0)
    nil
    (let [debris (basic-move debris)
          size (* size (- 1 (/ turn-millis life-time)))


(defn play-sound
  ([sound gain]
   (let [file (str "resources/" sound ".wav")]
     (when (.exists (as-file file))
       (let [audio-stream (AudioSystem/getAudioInputStream (File. file))
             clip (AudioSystem/getClip)
             ;volume (.getControl clip FloatControl$Type/MASTER_GAIN)
             ]
         #_(doto volume
             (.setValue gain))
         (doto clip
           (.open audio-stream)
           (.setFramePosition 0)
           (.start))
         ))))
  ([sound] (play-sound sound 0)))

(defn out-of-bounds? [{[x y] :position size :size}]
