another candle.

This commit is contained in:
2015-07-26 20:28:32 -07:00
parent 8200f4e43f
commit b09f530c54
8 changed files with 76 additions and 28 deletions

View File

@@ -26,7 +26,7 @@
(if (= :main cursor)
(:script entity)
(when-let [scripts (:scripts entity)]
(scripts (:value cursor)))))})))
(or (scripts (:value cursor)) (scripts :default)))))})))
(defn make [& {:keys [collision interactions entities] :as params}]
(let [interactions-as-list (for [[id spec] interactions]
(merge spec {:mouse-in? (fn [_ x y]
@@ -35,7 +35,7 @@
(if (= :main cursor)
(:script spec)
(when-let [scripts (:scripts spec)]
(scripts (:value cursor)))))
(or (scripts (:value cursor)) (scripts :default)))))
:id id}))
entities (into {} (for [[id entity] entities]
[id (make-entity id entity)]))]