final blergh encounter.
This commit is contained in:
@@ -110,7 +110,7 @@
|
||||
(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))))
|
||||
|
||||
(defn walk-straight-to [entities target-id [final-x final-y] & {:keys [update-baseline? face speed]}]
|
||||
(defn walk-straight-to [entities target-id [final-x final-y] & {:keys [update-baseline? face speed anim override-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)
|
||||
@@ -138,10 +138,10 @@
|
||||
(update-in entities [:room :entities target-id]
|
||||
#(start-animation screen
|
||||
(assoc (jump-to screen entities % [(+ moved-x from-x) (+ moved-y from-y)] update-baseline?)
|
||||
:facing (cond (< delta-x 0) :left
|
||||
(> delta-x 0) :right
|
||||
:else (:facing %)))
|
||||
:walk
|
||||
:facing (or override-dir (cond (< delta-x 0) :left
|
||||
(> delta-x 0) :right
|
||||
:else (:facing %))))
|
||||
(or anim :walk)
|
||||
))))))
|
||||
|
||||
(done? [this screen entities]
|
||||
@@ -455,6 +455,8 @@
|
||||
music-changed? (not= old-music new-music)]
|
||||
(run-action entities
|
||||
(begin [this screen entities]
|
||||
(doseq [[k] (get-in entities [:room :timers])]
|
||||
(remove-timer! screen k))
|
||||
(-> entities
|
||||
(assoc-in [:transition]
|
||||
(assoc (texture "black.png")
|
||||
@@ -508,6 +510,8 @@
|
||||
(<= (get-in entities [:transition :opacity]) 0.0))
|
||||
|
||||
(terminate [this screen entities]
|
||||
(doseq [[k [start time fn]] (get-in entities [:room :timers])]
|
||||
(add-timer! screen k start time))
|
||||
(dissoc entities :transition))
|
||||
|
||||
(can-skip? [this screen entities]
|
||||
|
||||
Reference in New Issue
Block a user