added drop sound.
This commit is contained in:
@@ -514,8 +514,11 @@
|
||||
:none)))
|
||||
|
||||
(defn play-sound
|
||||
([entities sound-file vol]
|
||||
(let [s (sound sound-file)]
|
||||
([entities sound-file vol & [wait?]]
|
||||
(let [wait? (if (nil? wait?) true wait?)
|
||||
s (if (string? sound-file)
|
||||
(sound sound-file)
|
||||
sound-file)]
|
||||
(run-action entities
|
||||
(begin [this screen entities]
|
||||
(utils/play-sound! screen entities s (constantly vol)))
|
||||
@@ -523,9 +526,11 @@
|
||||
(continue [this screen entities] entities)
|
||||
|
||||
(done? [this screen entities]
|
||||
(not (seq (filter
|
||||
#(= s (:sound %))
|
||||
(get-in entities [:current-sounds :value])))))
|
||||
(if wait?
|
||||
(not (seq (filter
|
||||
#(= s (:sound %))
|
||||
(get-in entities [:current-sounds :value]))))
|
||||
true))
|
||||
|
||||
(terminate [this screen entities]
|
||||
entities)
|
||||
|
||||
Reference in New Issue
Block a user