This commit is contained in:
2014-12-11 21:23:08 -08:00
parent 53b7efb6a4
commit 3572a09227
16 changed files with 80 additions and 5 deletions

View File

@@ -89,7 +89,7 @@
~@forms))
(reset! ~entities (<!! c#)))))
(defn walk-straight-to [entities target-id [final-x final-y] & {:keys [update-baseline? face]}]
(defn walk-straight-to [entities target-id [final-x final-y] & {:keys [update-baseline? face speed]}]
(let [{start-x :x start-y :y} (get-in @entities [:room :entities target-id])
final-x (int final-x)
final-y (int final-y)
@@ -103,7 +103,7 @@
(let [delta-x (- final-x from-x)
delta-y (- final-y from-y)
distance (utils/dist from-x from-y final-x final-y)
speed (* (or scale-x 1.0) 1.5)
speed (* (or scale-x 1.0) (or speed 1.5))
moved-x (if (= 0.0 distance)
0
(* speed (/ delta-x distance)))