particle effect.

This commit is contained in:
2015-02-21 01:33:06 -08:00
3 changed files with 40 additions and 32 deletions

View File

@@ -275,6 +275,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)
@@ -291,7 +293,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)

View File

@@ -449,7 +449,7 @@
:outside-jail (rooms.outside-jail/make screen)
:outside-castle (rooms.outside-castle/make screen)}
entities {:rooms rooms
:step-particles (assoc (particle-effect "ego/step") :x 100 :y 100 :baseline 241)
:cam {:zoom 0.95
:object nil}
:musics {:object nil