jail scene coming together
This commit is contained in:
@@ -252,6 +252,13 @@
|
||||
(assoc entities :actions {:channel channel :current current :started? false :script-running? (get-in entities [:actions :script-running?])}))))
|
||||
|
||||
|
||||
(defn update-from-hotspots [screen entities]
|
||||
(if-let [hot-spots (get-in entities [:room :hotspots])]
|
||||
(if-let [hotspot-hit (first (filter #((apply zone/box (:box %)) (get-in entities [:room :entities :ego :x]) (get-in entities [:room :entities :ego :y])) hot-spots))]
|
||||
((:fn hotspot-hit) screen entities)
|
||||
entities)
|
||||
entities))
|
||||
|
||||
(defn update-cursor [screen {{:keys [current override last]} :cursor :as entities}]
|
||||
(let [new-current (or override current)]
|
||||
(when-not (= new-current
|
||||
@@ -349,6 +356,7 @@
|
||||
(clear!)
|
||||
(let [entities (update-cursor screen entities)
|
||||
entities (update-from-script screen entities)
|
||||
entities (update-from-hotspots screen entities)
|
||||
entities (assoc-in entities [:room :entities :ego :last-frame] (get-in entities [:room :entities :ego :object]))
|
||||
entities (update-in entities [:room :entities] (fn [entities]
|
||||
(into entities
|
||||
|
||||
Reference in New Issue
Block a user