   (doseq [entity (sort-by z-order
                           (:entities @game-state))]
     (println entity)))
+
+(defn trigger-entity!
+  [entity]
+  (replace-entity (assoc-in entity [:components :movable :velocity] 0.5)))
+
+(defn try-activate!
+  []
+  (doseq [player (find-entities-by-component :controllable)]
+    (doseq [entity (find-entities-by-component :triggerable)]
+      (let [proximity (:proximity (utils/find-component :triggerable entity))]
+        (when (entity-proximity? player entity proximity)
+          (trigger-entity! entity))))))
 
 (defn keyboard-handler
   [event]

       :bounds [:boundable {:bounds v}]
       :controls [:controllable {:controls v}]
       :weapons [:weaponised v]
       nil))))

(defn make-entity

        [x y] (:position positionable)
        boundable (utils/find-component :boundable e)
        [width height] (:bounds boundable)
        surface (:surface @game-state)]
    ;;(println "name:" (:name e) "x,y:" [x y] "width, height:" [width height] "color:" color)
    (set! (.-fillStyle surface) color)
    (.fillRect surface x y width height)
