Refactor sounds

This commit is contained in:
2021-09-09 14:58:07 +01:00
parent be7b2d2cd7
commit 70c97f5367
26 changed files with 113 additions and 162 deletions
+7 -3
View File
@@ -28,7 +28,9 @@ makePoisonExplosionAt
:: Point2 -- ^ Position
-> World
-> World
makePoisonExplosionAt p w = soundOncePos grenadeBang p $ foldr (makeGasCloud p) w vels
makePoisonExplosionAt p w
= soundMultiFrom [Explosion 0,Explosion 1] p grenadeBang Nothing
$ foldr (makeGasCloud p) w vels
where
vels = replicateM 25 (randInCirc 2) & evalState $ _randGen w
-- just change the number after replicateM to get more or less clouds
@@ -54,7 +56,9 @@ makeFlameExplosionAt
:: Point2 -- ^ Position
-> World
-> World
makeFlameExplosionAt p w = soundOncePos grenadeBang p $ over particles (newFlames ++ ) w
makeFlameExplosionAt p w
= soundMultiFrom [Explosion 0,Explosion 1] p grenadeBang Nothing
$ over particles (newFlames ++ ) w
where
newFlames = zipWith makeFlameWithVelAndTime velocities timers
makeFlameWithVelAndTime vel time = aFlameParticle time p vel Nothing
@@ -68,7 +72,7 @@ makeExplosionAt
-> World
-> World
makeExplosionAt p w
= soundOncePos grenadeBang p
= soundMultiFrom [Explosion 0,Explosion 1] p grenadeBang Nothing
. addFlames
-- . explosionFlashAt p
. over tempLightSources (theTLS :)