more blinks.

This commit is contained in:
2015-10-11 18:59:20 -07:00
parent 8ead5bbf6b
commit 343d1f0e26
5 changed files with 27 additions and 10 deletions

View File

@@ -428,10 +428,13 @@
(play-sound! screen entities snd volume-fn pan :once))
([screen entities snd volume-fn pan type]
(play-sound! screen entities snd volume-fn pan :once 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)) 1.0 pan)
(sound! snd :loop (scale-vol-from-fade entities (current-sound-volume vol)) 1.0 pan)) ]
(sound! snd :play (scale-vol-from-fade entities (current-sound-volume vol)) (or pitch 1.0) pan )
(sound! snd :loop (scale-vol-from-fade entities (current-sound-volume vol)) (or pitch 1.0) pan )) ]
(update-in entities [:current-sounds :value]
conj {:id sound-id
:sound snd