cauldron sound.
This commit is contained in:
BIN
desktop/asset-work/outsidehouse/cauldron.ogg
Normal file
BIN
desktop/asset-work/outsidehouse/cauldron.ogg
Normal file
Binary file not shown.
BIN
desktop/asset-work/outsidehouse/cauldron.wav
Normal file
BIN
desktop/asset-work/outsidehouse/cauldron.wav
Normal file
Binary file not shown.
BIN
desktop/resources/outsidehouse/cauldron.ogg
Normal file
BIN
desktop/resources/outsidehouse/cauldron.ogg
Normal file
Binary file not shown.
@@ -506,12 +506,19 @@
|
||||
(update-in entities [:room :entities] #(assoc % :note (get-in entities [:room :note])))
|
||||
entities))
|
||||
|
||||
(defn make-night [entities]
|
||||
(-> entities
|
||||
(update-in [:room :entities] #(dissoc % :butterfly))
|
||||
(update-in [:room :entities] #(assoc % :cauldron (get-in entities [:room :cauldron])))
|
||||
add-wizard-if-necessary
|
||||
add-note-if-necessary))
|
||||
(defn make-night [screen entities]
|
||||
|
||||
(as-> entities entities
|
||||
|
||||
(update-in entities [:room :entities] #(dissoc % :butterfly))
|
||||
(update-in entities [:room :entities] #(assoc % :cauldron (get-in entities [:room :cauldron])))
|
||||
(utils/play-sound! screen entities
|
||||
(get-in entities [:room :cauldron-sound :sound])
|
||||
(utils/sourced-volume-fn :cauldron 0.1 [139 73])
|
||||
(utils/get-sound-pan 139)
|
||||
:loop)
|
||||
(add-wizard-if-necessary entities)
|
||||
(add-note-if-necessary entities)))
|
||||
|
||||
(defn move-toward [screen entities {:keys [x y] :as e} target-x]
|
||||
(let [delta-x (- target-x x)
|
||||
@@ -590,6 +597,7 @@
|
||||
(aget lamb-walk-sheet 0 i)))]
|
||||
(rooms/make :music {:day :town-2 :night :night}
|
||||
:update-fn jump-around
|
||||
:cauldron-sound {:object nil :sound (utils/load-sound "outsidehouse/cauldron.ogg")}
|
||||
:interactions
|
||||
{:door {:box [250 100 281 160]
|
||||
:script
|
||||
@@ -787,7 +795,7 @@
|
||||
(common/read-note-1 entities))))
|
||||
:collision "outsidehouse/collision.png"
|
||||
:scale-fn scaler
|
||||
:apply-state (fn [_ entities]
|
||||
:apply-state (fn [screen entities]
|
||||
(utils/fast-forward-particle (get-in entities [:room :entities :outside-particles]))
|
||||
(as-> entities entities
|
||||
(if (get-in entities [:state :coaxed-sheep?])
|
||||
@@ -795,6 +803,6 @@
|
||||
(update-in entities [:room :entities :sheep] #(assoc % :x 90 :y 138 :baseline 40 :scale-x scale :scale-y scale)))
|
||||
entities)
|
||||
(if (= :night (get-in entities [:state :time]))
|
||||
(make-night entities)
|
||||
(make-night screen entities)
|
||||
entities)))
|
||||
:start-pos [30 80])))
|
||||
|
||||
@@ -445,6 +445,7 @@
|
||||
(play-sound! screen entities snd volume-fn pan type 1.0))
|
||||
|
||||
([screen entities snd volume-fn pan type pitch]
|
||||
|
||||
(let [vol (volume-fn entities)
|
||||
sound-id (if (= :once type)
|
||||
(sound! snd :play (scale-vol-from-fade entities (current-sound-volume vol)) (or pitch 1.0) pan )
|
||||
|
||||
Reference in New Issue
Block a user