Refactor sounds
This commit is contained in:
@@ -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 :)
|
||||
|
||||
@@ -97,7 +97,7 @@ moveFlame rotd w pt
|
||||
_ -> (glare $ doSound damcrs , mvPt)
|
||||
where
|
||||
time = _btTimer' pt
|
||||
doSound = soundFrom Flame fireSound 2 500 -- . over worldEvents ((.) $ flameGlareAt ep)
|
||||
doSound = soundFrom Flame (V2 x y) fireSound (Just 2) -- . over worldEvents ((.) $ flameGlareAt ep)
|
||||
glare
|
||||
| time `mod` 5 == 0
|
||||
= tempLightSources %~ (theTLS :)
|
||||
|
||||
Reference in New Issue
Block a user