Remove loop dependency on loading dodge sounds

This commit is contained in:
jgk
2021-03-27 13:42:14 +01:00
parent 2897c65e9e
commit 2011728de5
10 changed files with 171 additions and 153 deletions
+6 -2
View File
@@ -4,6 +4,8 @@ import Dodge.Data
import Dodge.Base
import Dodge.SoundLogic
import Dodge.WorldEvent.Sound
import Dodge.LevelGen.Pathing
import Geometry
@@ -40,9 +42,11 @@ killBlock bl w = f bl .
where
f bl@(Block {_blDegrades = (x:xs)}) = degradeBlock bl . hitSound bl
f bl = hitSound' bl
hitSound bl | _wlIsSeeThrough bl = soundMultiFrom sos (soundid+8) 25 0
hitSound bl | _wlIsSeeThrough bl = mkSoundBreakGlass
-- hitSound bl | _wlIsSeeThrough bl = soundMultiFrom sos (soundid+8) 25 0
| otherwise = soundMultiFrom sos soundid 25 0
hitSound' bl | _wlIsSeeThrough bl = soundMultiFrom sos (soundid+4) 25 0
hitSound' bl | _wlIsSeeThrough bl = mkSoundSplinterGlass
-- hitSound' bl | _wlIsSeeThrough bl = soundMultiFrom sos (soundid+4) 25 0
| otherwise = soundMultiFrom sos soundid 25 0
sos = [BlockDegradeSound 0,BlockDegradeSound 1]
(soundid,_) = randomR (29,32) $ _randGen w