refactored sounds so they're never dynamically loaded.
This commit is contained in:
@@ -267,7 +267,6 @@ void main ()
|
||||
(get-in @entities [:room :entities :warden])
|
||||
(do
|
||||
(actions/talk entities :ego "I'll just take a sip!")
|
||||
(sound! (utils/load-sound "ego/potion.ogg") :play (utils/current-sound-volume))
|
||||
(actions/play-animation entities :ego :grow :stop? false)
|
||||
(actions/talk entities :warden "Huh? What was that?!")
|
||||
(Thread/sleep 1000)
|
||||
@@ -277,7 +276,6 @@ void main ()
|
||||
:else
|
||||
(do
|
||||
(actions/talk entities :ego "I'll just take a sip!")
|
||||
(sound! (utils/load-sound "ego/potion.ogg") :play (utils/current-sound-volume))
|
||||
(actions/play-animation entities :ego :grow :stop? false))))
|
||||
|
||||
:recipe
|
||||
@@ -664,10 +662,10 @@ void main ()
|
||||
:inside-step-sound-2 (utils/load-sound "ego/inside-step-2.ogg")
|
||||
:inside-step-sound-3 (utils/load-sound "ego/inside-step-3.ogg")
|
||||
:inside-step-sound-4 (utils/load-sound "ego/inside-step-4.ogg")
|
||||
:grow-sound (utils/load-sound "ego/potion.ogg")
|
||||
:sigh-sound (utils/load-sound "ego/sigh.ogg")
|
||||
:breakglass-sound (utils/load-sound "ego/breakglass.ogg")
|
||||
:idea-sound (utils/load-sound "ego/idea.ogg")
|
||||
:blink (utils/load-sound "ego/blink2.ogg")
|
||||
:scale-x start-scale
|
||||
:scale-y start-scale
|
||||
:talk-color (color 0.6 1.0 1.0 1.0)
|
||||
@@ -682,13 +680,15 @@ void main ()
|
||||
:x (first start-pos) :y (last start-pos)
|
||||
:id "ego"}
|
||||
|
||||
ego (assoc ego :anim-sound-frames {(get-in ego [:left :walk]) {2 [choose-step-sound 0.3]
|
||||
6 [choose-step-sound 0.3]}
|
||||
(get-in ego [:right :walk]) {2 [choose-step-sound 0.3]
|
||||
6 [choose-step-sound 0.3]}
|
||||
ego (assoc ego :anim-sound-frames {(get-in ego [:left :walk]) {2 [choose-step-sound 0.5]
|
||||
6 [choose-step-sound 0.5]}
|
||||
(get-in ego [:right :walk]) {2 [choose-step-sound 0.5]
|
||||
6 [choose-step-sound 0.5]}
|
||||
|
||||
(get-in ego [:left :talk] ) {2 [:blink 0.15]}
|
||||
(get-in ego [:right :talk] ) {2 [:blink 0.15]}
|
||||
(get-in ego [:left :grow] ) {1 [:grow-sound 0.5]}
|
||||
(get-in ego [:right :grow] ) {1 [:grow-sound 0.5]}
|
||||
|
||||
(get-in ego [:left :stand]) {11 [:blink 0.15]
|
||||
44 [:blink 0.15]
|
||||
@@ -850,7 +850,7 @@ void main ()
|
||||
(snd entities)
|
||||
snd)]
|
||||
(utils/play-sound! screen entities
|
||||
(or (snd e) (snd (:sounds entities)))
|
||||
(or (snd e) snd)
|
||||
(utils/sourced-volume-fn target vol-scale [x y])
|
||||
(utils/get-sound-pan x)
|
||||
:once
|
||||
@@ -872,7 +872,7 @@ void main ()
|
||||
[{:keys [id sound volume-fn]} & rest] (get-in entities [:current-sounds :value])]
|
||||
(if id
|
||||
(do
|
||||
(sound! sound :set-volume id (utils/scale-vol-from-fade entities (volume-fn entities)))
|
||||
(sound! sound :set-volume id (utils/scale-vol-from-fade entities (utils/current-sound-volume (volume-fn entities))))
|
||||
(recur entities rest))
|
||||
entities)))
|
||||
|
||||
@@ -1047,6 +1047,8 @@ void main ()
|
||||
:closing? {:object nil
|
||||
:value false}
|
||||
:sounds {:blink (utils/load-sound "ego/blink2.ogg")
|
||||
:pickup (utils/load-sound "pickup.ogg")
|
||||
:disappear (utils/load-sound "inside-house/disappear.ogg")
|
||||
:object nil}
|
||||
:fade {:object nil
|
||||
:opacity 0.0}
|
||||
|
||||
Reference in New Issue
Block a user