step back.

This commit is contained in:
2015-02-12 21:16:21 -08:00
parent d576e377ed
commit e0a35216f0
2 changed files with 14 additions and 12 deletions

View File

@@ -204,7 +204,7 @@
(terminate [this screen entities] entities)
(can-skip? [this screen entities] false)))
(defn walk-to [entities target-id [final-x final-y] & {:keys [can-skip? face]}]
(defn walk-to [entities target-id [final-x final-y] & {:keys [can-skip? face force-dir]}]
(let [{start-x :x start-y :y} (get-in @entities [:room :entities target-id])
final-x (int final-x)
final-y (int final-y)
@@ -242,9 +242,10 @@
(update-in entities [:room :entities target-id]
#(start-animation screen
(assoc (jump-to screen entities % [(+ moved-x from-x) (+ moved-y from-y)] true)
:facing (cond (< delta-x 0) :left
(> delta-x 0) :right
:else (:facing %)))
:facing (cond force-dir force-dir
(< delta-x 0) :left
(> delta-x 0) :right
:else (:facing %)))
:walk
))))))