more simplification.
This commit is contained in:
@@ -430,22 +430,10 @@
|
||||
:collision "outside-castle/collision.png"
|
||||
:scale-fn (utils/scaler-fn-from-image "outside-castle/scale-map.png" 0.20 1.00)
|
||||
:start-pos [259 80]
|
||||
:apply-state (fn [_ entities]
|
||||
:apply-state (fn [screen entities]
|
||||
(utils/fast-forward-particle (get-in entities [:room :entities :outside-particles]))
|
||||
(->
|
||||
(as-> entities entities
|
||||
(if (#{:night :sunrise} (get-in entities [:state :time]))
|
||||
(make-night entities)
|
||||
entities)
|
||||
(assoc-in [:room :flies-sound :id] (sound! (get-in entities [:room :flies-sound :sound]) :loop (flies-vol entities)))))
|
||||
|
||||
:update-fn (fn [_ entities]
|
||||
(when-let [flies-sound-id (get-in entities [:room :flies-sound :id])]
|
||||
(sound! (get-in entities [:room :flies-sound :sound]) :set-volume flies-sound-id (flies-vol entities)))
|
||||
entities)
|
||||
|
||||
:stop-fn (fn [_ entities]
|
||||
(when-let [flies-sound-id (get-in entities [:room :flies-sound :id])]
|
||||
(sound! (get-in entities [:room :flies-sound :sound]) :stop flies-sound-id))
|
||||
entities)
|
||||
|
||||
)))
|
||||
(utils/play-sound! screen entities (get-in entities [:room :flies-sound :sound]) flies-vol 0.5 :loop))))))
|
||||
|
||||
Reference in New Issue
Block a user