   (assoc state :obstacles [{:position (Vector. (:x e) (:y e))
                             :radius 50}]))
 
+(defn mouse-clicked [state e]
+  (assoc state :flock? (not (:flock? state))))
+
 (defn boids-sketch []
   (q/sketch
     :host "boids-sketch"


(defn update-boids [state]
  (assoc state :boids (map (fn [b]
                             (update-boid b (:boids state) (:obstacles state))) (:boids state) )))

(defn draw [state]
  (q/background 200)

(ns boids.core
  (:require [quil.core :as q :include-macros true]
            [quil.middleware :as m :include-macros true]))

(defprotocol PVec
  (add [a b])
