performance enhancement.
This commit is contained in:
@@ -66,9 +66,12 @@
|
||||
;; function for an action
|
||||
(let [initial-time (atom nil)]
|
||||
(fn [screen entities]
|
||||
(swap! initial-time #(or % (:total-time screen)))
|
||||
|
||||
(let [target-y (get-in entities [target-id :y])
|
||||
|
||||
(let [
|
||||
begin? (not@initial-time)
|
||||
_ (swap! initial-time #(or % (:total-time screen)))
|
||||
target-y (get-in entities [target-id :y])
|
||||
scale-fn (get-in entities [:background :scale-fn])
|
||||
scale (scale-fn target-y)
|
||||
height (* scale 36)
|
||||
@@ -80,8 +83,9 @@
|
||||
(run! dialogue/talking-screen :stop-talk :target-id target-id)
|
||||
(update-in entities [target-id :actions] rest))
|
||||
(do
|
||||
(run! dialogue/talking-screen :on-talk :text text
|
||||
:x (get-in entities [target-id :x]) :y (+ (get-in entities [target-id :y]) height)
|
||||
:target-id target-id
|
||||
:scale scale)
|
||||
(when begin?
|
||||
(run! dialogue/talking-screen :on-talk :text text
|
||||
:x (get-in entities [target-id :x]) :y (+ (get-in entities [target-id :y]) height)
|
||||
:target-id target-id
|
||||
:scale scale))
|
||||
(assoc-in entities [target-id :anim] (get-in entities [target-id :talk]))))))))
|
||||
|
||||
@@ -65,6 +65,7 @@
|
||||
(conj path (from-scale current-node))
|
||||
(came-from (vec current-node))))))))
|
||||
|
||||
|
||||
(def d2 ^double (- (Math/sqrt 2) 2))
|
||||
(defn heuristic ^long [^long goal-x ^long goal-y ^long current-x ^long current-y]
|
||||
(let [dist-x (if (< goal-x current-x)
|
||||
|
||||
Reference in New Issue
Block a user