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

@@ -35,13 +35,13 @@
(not (get-in entities [:state :blergh-dead?]))
(actions/has-item? entities :magic-slingshot))
((actions/get-script entities
(sound! (utils/load-sound "space/shock.ogg") :play (utils/current-sound-volume))
(actions/play-animation entities :bloodclot-head :shoot :stop? false)
(actions/update-entity entities :lightning #(assoc % :opacity 1.0))
(actions/begin-animation entities :bloodclot-head :keep-shoot)
(Thread/sleep 2000)
(actions/update-entity entities :lightning #(assoc % :opacity 0.0))
(actions/do-dialogue entities :bloodclot-head "Dang! Come a little closer!"))
(actions/play-sound entities :shock 0.25 :wait? false)
(actions/play-animation entities :bloodclot-head :shoot :stop? false)
(actions/update-entity entities :lightning #(assoc % :opacity 1.0))
(actions/begin-animation entities :bloodclot-head :keep-shoot)
(Thread/sleep 2000)
(actions/update-entity entities :lightning #(assoc % :opacity 0.0))
(actions/do-dialogue entities :bloodclot-head "Dang! Come a little closer!"))
entities))
nil)
@@ -62,7 +62,7 @@
(begin [this screen entities]
(particle-effect! (get-in entities [:room :entities :appear]) :reset)
(particle-effect! (get-in entities [:room :entities :appear]) :start)
(sound! (utils/load-sound "inside-house/disappear.ogg") :play (utils/current-sound-volume))
(utils/play-sound! screen entities :disappear (constantly 0.7))
(-> entities
(assoc-in [:tweens :bloodclot-head-appear]
(tween/tween :bloodclot-head-appear screen [:room :entities :bloodclot-head :opacity] 1.0 0.0 1.0 :ease tween/ease-in-cubic))
@@ -91,7 +91,8 @@
(actions/run-action entities
(begin [this screen entities]
(sound! (utils/load-sound "space/jump.ogg") :play (utils/current-sound-volume))
(utils/play-sound! screen entities :jump (constantly 0.9))
(-> entities
(assoc-in [:room :entities :cloud] (assoc (utils/get-texture "space/cloud.png")
:x (- (get-in entities [:room :entities :ego :x]) 10)
@@ -138,7 +139,8 @@
(actions/run-action entities
(begin [this screen entities]
(sound! (utils/load-sound "space/swingsword.ogg") :play (utils/current-sound-volume))
(utils/play-sound! screen entities :swing-sword (constantly 0.9))
(-> entities
(update-in [:room :entities :ego]
#(actions/start-animation screen % :swing))
@@ -191,6 +193,9 @@
lightning-effect (particle-effect "particles/lightning")
grow-explode (particle-effect "particles/grow-explode")]
(rooms/make :music :fight
:sounds {:shock (utils/load-sound "space/shock.ogg")
:jump (utils/load-sound "space/jump.ogg")
:swing-sword (utils/load-sound "space/swingsword.ogg")}
:interactions
{}
:layers [(assoc (utils/get-texture "space/background.png") :x 0 :y 0 :baseline 0)]
@@ -255,7 +260,8 @@
(actions/do-dialogue entities :bloodclot-head "Ha ha ha! Is that the best you can do?"
:bloodclot-head "Take this!")
(sound! (utils/load-sound "space/shock.ogg") :play (utils/current-sound-volume))
(actions/play-sound entities :shock 0.25 :wait? false)
(actions/play-animation entities :bloodclot-head :shoot :stop? false)
(actions/begin-animation entities :bloodclot-head :keep-shoot)
(actions/update-entity entities :lightning #(assoc % :opacity 1.0))