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

@@ -6,22 +6,24 @@ lowMin: 100.0
lowMax: 100.0 lowMax: 100.0
- Count - - Count -
min: 0 min: 0
max: 200 max: 100
- Emission - - Emission -
lowMin: 5.0 lowMin: 2.0
lowMax: 5.0 lowMax: 2.0
highMin: 60.0 highMin: 1.0
highMax: 60.0 highMax: 1.0
relative: false relative: false
scalingCount: 1 scalingCount: 2
scaling0: 1.0 scaling0: 1.0
timelineCount: 1 scaling1: 1.0
timelineCount: 2
timeline0: 0.0 timeline0: 0.0
timeline1: 1.0
- Life - - Life -
lowMin: 2000.0 lowMin: 500.0
lowMax: 2000.0 lowMax: 500.0
highMin: 500.0 highMin: 1000.0
highMax: 1000.0 highMax: 5500.0
relative: false relative: false
scalingCount: 3 scalingCount: 3
scaling0: 1.0 scaling0: 1.0
@@ -71,15 +73,17 @@ timelineCount: 1
timeline0: 0.0 timeline0: 0.0
- Velocity - - Velocity -
active: true active: true
lowMin: 0.0 lowMin: 10.0
lowMax: 0.0 lowMax: 10.0
highMin: 5.0 highMin: 20.0
highMax: 5.0 highMax: 25.0
relative: false relative: false
scalingCount: 1 scalingCount: 2
scaling0: 1.0 scaling0: 1.0
timelineCount: 1 scaling1: 0.0
timelineCount: 2
timeline0: 0.0 timeline0: 0.0
timeline1: 0.94520545
- Angle - - Angle -
active: true active: true
lowMin: 90.0 lowMin: 90.0
@@ -101,24 +105,24 @@ active: false
active: false active: false
- Gravity - - Gravity -
active: true active: true
lowMin: 2.0 lowMin: 10.0
lowMax: 2.0 lowMax: 10.0
highMin: -10.0 highMin: -30.0
highMax: -10.0 highMax: -30.0
relative: false relative: false
scalingCount: 3 scalingCount: 3
scaling0: 0.0 scaling0: 0.0
scaling1: 0.7755102 scaling1: 0.79591835
scaling2: 1.0 scaling2: 1.0
timelineCount: 3 timelineCount: 3
timeline0: 0.0 timeline0: 0.0
timeline1: 0.6369863 timeline1: 0.24657534
timeline2: 0.9589041 timeline2: 0.9589041
- Tint - - Tint -
colorsCount: 3 colorsCount: 3
colors0: 1.0 colors0: 0.8
colors1: 1.0 colors1: 0.6392157
colors2: 1.0 colors2: 0.37254903
timelineCount: 1 timelineCount: 1
timeline0: 0.0 timeline0: 0.0
- Transparency - - Transparency -
@@ -129,13 +133,13 @@ highMax: 1.0
relative: false relative: false
scalingCount: 4 scalingCount: 4
scaling0: 0.0 scaling0: 0.0
scaling1: 1.0 scaling1: 0.3508772
scaling2: 0.75 scaling2: 0.0
scaling3: 0.0 scaling3: 0.0
timelineCount: 4 timelineCount: 4
timeline0: 0.0 timeline0: 0.0
timeline1: 0.2 timeline1: 0.001
timeline2: 0.8 timeline2: 0.7671233
timeline3: 1.0 timeline3: 1.0
- Options - - Options -
attached: false attached: false

View File

@@ -275,6 +275,8 @@
entities)) entities))
(continue [this screen 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]) (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] [[target-x target-y] remainder] @targets-left]
(let [delta-x (- target-x from-x) (let [delta-x (- target-x from-x)
@@ -291,7 +293,9 @@
(do (swap! targets-left rest) (do (swap! targets-left rest)
(-> entities (-> entities
(assoc-in [:room :entities target-id :x] target-x) (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] (update-in entities [:room :entities target-id]
#(start-animation screen #(start-animation screen
(assoc (jump-to screen entities % [(+ moved-x from-x) (+ moved-y from-y)] true) (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-jail (rooms.outside-jail/make screen)
:outside-castle (rooms.outside-castle/make screen)} :outside-castle (rooms.outside-castle/make screen)}
entities {:rooms rooms entities {:rooms rooms
:step-particles (assoc (particle-effect "ego/step") :x 100 :y 100 :baseline 241)
:cam {:zoom 0.95 :cam {:zoom 0.95
:object nil} :object nil}
:musics {:object nil :musics {:object nil