sound progress.
This commit is contained in:
@@ -46,9 +46,7 @@
|
||||
(actions/has-obtained? entities :sword)
|
||||
0.0
|
||||
:else
|
||||
(* (max 0.0 (- 1.0 (/ (utils/dist 45 97 (:x ego) (:y ego)) 50.0)))
|
||||
(- 1.0 (get-in entities [:fade :opacity]))
|
||||
(get-in entities [:volume :value] 1.0)))))
|
||||
(max 0.0 (- 1.0 (/ (utils/dist 45 97 (:x ego) (:y ego)) 50.0))))))
|
||||
|
||||
(defn bloodclot-appear [entities]
|
||||
(actions/run-action entities
|
||||
@@ -626,9 +624,14 @@
|
||||
:chorus {:sound (utils/load-sound "inside-castle/chorus.ogg")}
|
||||
:collision "inside-castle/collision.png"
|
||||
:scale-fn (utils/scaler-fn-from-image "inside-castle/scale.png" 0.25 1.00)
|
||||
:apply-state (fn [_ entities]
|
||||
:apply-state (fn [screen entities]
|
||||
(utils/fast-forward-particle (get-in entities [:room :entities :outside-particles]))
|
||||
(as-> entities entities
|
||||
(utils/play-sound! screen entities
|
||||
(get-in entities [:room :chorus :sound])
|
||||
get-chorus-volume
|
||||
0.5
|
||||
:loop)
|
||||
(if (actions/has-obtained? entities :trophy)
|
||||
(update-in entities [:room :entities] #(dissoc % :trophy))
|
||||
entities)
|
||||
@@ -642,23 +645,5 @@
|
||||
(if (#{:night :sunrise} (get-in entities [:state :time]))
|
||||
(make-night entities)
|
||||
entities)))
|
||||
:update-fn (fn [screen entities]
|
||||
#_(when (and (actions/has-obtained? entities :sword)
|
||||
(get-in entities [:room :entities :magic])
|
||||
(particle-effect! (get-in entities [:room :entities :magic]) :is-complete))
|
||||
)
|
||||
(let [chorus-volume (get-chorus-volume entities)]
|
||||
(if (= 0.0 chorus-volume)
|
||||
(if (get-in entities [:room :chorus :instance])
|
||||
(do (sound! (get-in entities [:room :chorus :sound]) :stop)
|
||||
(update-in entities [:room :chorus] dissoc :instance))
|
||||
entities)
|
||||
(let [chorus (get-in entities [:room :chorus])]
|
||||
(if (:instance chorus)
|
||||
(do (sound! (:sound chorus) :set-volume
|
||||
(:instance chorus)
|
||||
(utils/current-sound-volume chorus-volume))
|
||||
entities)
|
||||
(assoc-in entities [:room :chorus :instance] (sound! (:sound chorus) :loop
|
||||
(utils/current-sound-volume chorus-volume))))))))
|
||||
|
||||
:start-pos [245 90])))
|
||||
|
||||
@@ -283,7 +283,9 @@
|
||||
|
||||
(as-> entities entities
|
||||
(utils/play-sound! screen entities (get-in entities [:room :fountain-sound :sound])
|
||||
:fountain 0.5 [172 120] :loop)
|
||||
(utils/sourced-volume-fn :fountain 0.5 [172 120])
|
||||
(utils/get-sound-pan 172)
|
||||
:loop)
|
||||
|
||||
(if (= :night (get-in entities [:state :time]))
|
||||
(make-night entities)
|
||||
|
||||
Reference in New Issue
Block a user