refactored sounds so they're never dynamically loaded.

This commit is contained in:
Bryce Covert
2015-10-29 20:04:08 -07:00
parent 78a4ddfce6
commit 614156245a
11 changed files with 57 additions and 33 deletions

View File

@@ -187,6 +187,10 @@
:shopkeep "That teddy bear does not leave my store."
:shopkeep "My son would be stricken with grief to find it missing."))))]
(rooms/make :music :inside-antique
:sounds {:fire-1 (utils/load-sound "inside-antique/fire-1.ogg")
:fire-2 (utils/load-sound "inside-antique/fire-2.ogg")
:fire-3 (utils/load-sound "inside-antique/fire-3.ogg")
}
:interactions
{:right {:box [250 0 320 75]
:cursor :right
@@ -339,7 +343,8 @@
(actions/talk entities :ego "I'll just try another one of these mints."))
(actions/play-animation entities :ego :reach)
(actions/update-state entities (fn [s] (assoc s :mints-eaten (inc (s :mints-eaten)))))
(sound! (utils/load-sound (str "inside-antique/fire-" (get-in @entities [:state :mints-eaten]) ".ogg")) :play (utils/current-sound-volume))
(actions/play-sound entities (keyword (str "fire-" (get-in @entities [:state :mints-eaten]))) 0.8)
(cond
(= 2 (get-in @entities [:state :mints-eaten]))
(do (particle-effect! (get-in @entities [:room :entities :smoke-particle]) :reset)