     (assoc player
         :eff bullet-efficiency
         :acc bullet-acceleration
+        :sparkle-color Color/PINK
 ))
+
+(defn make-new-sparkles [objects time-step]
+    (map
+        (fn [o]
+            (let [
+                a (rand (* 2.0 Math/PI))
+                v (rand sparkle-velocity)]
+                (assoc o
+                    :acc 0.0
+                    :eff sparkle-efficiency
+                    :xv (+ (:xv o) (* v (:acc o) (Math/cos a)))
+                    :yv (+ (:yv o) (* v (:acc o) (Math/sin a))))))
+        (filter
+            (fn [o] (> (* (:acc o) time-step sparkle-amount) (rand)))
+            objects)))
+
+(defn mag [x y] (Math/sqrt (+ (* x x) (* y y))))
+
+(defn sparkle-is-alive [sparkle]
+    (> (mag (:xv sparkle) (:yv sparkle)) 2.0))
 
 (defn game-step [state keys-pressed]
     (let [

(defn bullet-shape []
    (doto
        (new Polygon)
        (.addPoint 2 0)
        (.addPoint -2 1)
        (.addPoint -2 -1)))

(defn draw-player [player g]
    (do

                :next-fire-time
                    (if spawn-new-bullet
                        (+ new-time fire-delay)
                        (:next-fire-time state))
                :sparkles
                    (doall (map (fn [s] (step-thing s time-step))
                        (concat
                            (make-new-sparkles (cons (:player state) (:bullets state)) time-step)
                            (filter sparkle-is-alive (:sparkles state))))))
        [fb fa]
            (filter-collisions (:bullets state) (:asteroids state))
        state
