cauldron sound.

This commit is contained in:
2015-10-27 20:24:05 -07:00
parent 6a6e702dbe
commit 1d25ba98b5
5 changed files with 17 additions and 8 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -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])))

View File

@@ -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 )