particled step.
This commit is contained in:
@@ -224,6 +224,8 @@
|
||||
entities)
|
||||
|
||||
(continue [this screen entities]
|
||||
(when (= (rand-int 50) 2)
|
||||
(particle-effect! (:step-particles entities) :start))
|
||||
(let [{from-x :x from-y :y :keys [left right scale-x] :as target-entity} (get-in entities [:room :entities target-id])
|
||||
[[target-x target-y] remainder] @targets-left]
|
||||
(let [delta-x (- target-x from-x)
|
||||
@@ -240,7 +242,9 @@
|
||||
(do (swap! targets-left rest)
|
||||
(-> entities
|
||||
(assoc-in [:room :entities target-id :x] target-x)
|
||||
(assoc-in [:room :entities target-id :y] target-y)))
|
||||
(assoc-in [:room :entities target-id :y] target-y)
|
||||
(assoc-in [:step-particles :x] target-x)
|
||||
(assoc-in [:step-particles :y] target-y)))
|
||||
(update-in entities [:room :entities target-id]
|
||||
#(start-animation screen
|
||||
(assoc (jump-to screen entities % [(+ moved-x from-x) (+ moved-y from-y)] true)
|
||||
|
||||
Reference in New Issue
Block a user