Refactor sound
This commit is contained in:
@@ -6,8 +6,10 @@ import Dodge.Base
|
||||
import Dodge.Zone
|
||||
import Dodge.Zone.Data
|
||||
import Dodge.SoundLogic
|
||||
import Dodge.SoundLogic.LoadSound
|
||||
import Dodge.WorldEvent.Sound
|
||||
import Dodge.LevelGen.Pathing
|
||||
import Dodge.RandomHelp
|
||||
import Geometry
|
||||
import Picture.Data
|
||||
import qualified IntMapHelp as IM
|
||||
@@ -46,12 +48,12 @@ killBlock bl w = f bl . flip (foldr unshadow) (_blShadows bl) $ w
|
||||
pos = fst $ _wlLine bl
|
||||
breakHitSound bl'
|
||||
| _wlIsSeeThrough bl' = mkSoundBreakGlass pos
|
||||
| otherwise = soundMultiFrom sos (fst $ _wlLine bl') (soundid + 4) Nothing
|
||||
| otherwise = soundMultiFrom sos (fst $ _wlLine bl') impactSound Nothing
|
||||
hitSound' bl'
|
||||
| _wlIsSeeThrough bl' = mkSoundSplinterGlass pos
|
||||
| otherwise = soundMultiFrom sos (fst $ _wlLine bl') soundid Nothing
|
||||
| otherwise = soundMultiFrom sos (fst $ _wlLine bl') impactSound Nothing
|
||||
sos = [BlockDegradeSound 0,BlockDegradeSound 1]
|
||||
(soundid,_) = randomR (29,32) $ _randGen w
|
||||
impactSound = evalState (takeOne [impact1S,impact2S,impact3S,impact4S]) $ _randGen w
|
||||
unshadow :: Int -> World -> World
|
||||
unshadow bid w' = case w' ^? walls . ix bid of
|
||||
Just b ->
|
||||
|
||||
Reference in New Issue
Block a user