diff --git a/desktop/src-common/advent/screens/rooms/outside_castle.clj b/desktop/src-common/advent/screens/rooms/outside_castle.clj index 25a52542..9d9c4b5a 100644 --- a/desktop/src-common/advent/screens/rooms/outside_castle.clj +++ b/desktop/src-common/advent/screens/rooms/outside_castle.clj @@ -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))))))