opening the cell.
This commit is contained in:
@@ -99,13 +99,16 @@
|
||||
(or (get-in entity [(:facing entity) anim])
|
||||
(get entity anim))))
|
||||
|
||||
(defn start-animation [screen entity anim]
|
||||
(let [new-anim (find-animation entity anim)]
|
||||
(if (and anim (not= new-anim (:anim entity)))
|
||||
(assoc entity
|
||||
:anim new-anim
|
||||
:anim-start (:total-time screen))
|
||||
entity)))
|
||||
(defn start-animation
|
||||
([entity anim]
|
||||
(start-animation {:total-time 0} entity anim))
|
||||
([screen entity anim]
|
||||
(let [new-anim (find-animation entity anim)]
|
||||
(if (and anim (not= new-anim (:anim entity)))
|
||||
(assoc entity
|
||||
:anim new-anim
|
||||
:anim-start (:total-time screen))
|
||||
entity))))
|
||||
|
||||
(defn stop [screen entities target-id & {:keys [face]}]
|
||||
(update-in entities [:room :entities target-id] (comp #(start-animation screen % :stand) (if face #(assoc % :facing face) identity))))
|
||||
|
||||
Reference in New Issue
Block a user