From 54a8ccf799f8bcfa7e0af50857d4bb14278c1951 Mon Sep 17 00:00:00 2001 From: Bryce Covert Date: Wed, 7 Oct 2015 18:37:55 -0700 Subject: [PATCH] more simplification. --- .../advent/screens/rooms/outside_castle.clj | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) 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))))))