 ;; define your app data so that it doesn't get over-written on reload
 
 (defn init-critters []
-    (let [names ["Slipper" "Allegra" "Squeaky" "Sarah Jane" "Totoro"]]
-        (map #(hash-map :name % :x (rand-int 500) :y (rand-int 500)) names)))
+    (let [names ["Slipper" "Allegra" "Squeaky" "Sarah Jane" "Totoro"
+        ]]
+        (map #(hash-map 
+            :name % 
+            :x (rand-int 500) 
+            :y (rand-int 500)
+            :velocity {:r 0 :angle 0}) 
+        names)))
 
 (defonce app-state (atom {
     :critters (init-critters)


(defn to-random-nearby [it] 
    (let [{:keys [x y]} it]        
        (assoc it :x (+ (rand-center 5) x) 
                  :y (+ (rand-center 5) y))))

(defn center-of-points [ps] 
    {:x (mean (map :x ps))
     :y (mean (map :y ps))})

(defn to-point-fn [f] (fn [a b] 
    (assoc a :x (f (:x a) (:x b))

(defn module-critter [critter] 
    (let [{:keys [x y]} critter]
        [:g.module-critter 
            {:style {:transition "transform 500ms"
                     :transform (translate x y)}}
            [:circle {:r 20 :style {:fill "brown"}}]]))

