Commit before trying to add machine footprint

This commit is contained in:
2026-03-31 13:57:48 +01:00
parent 6bcf03b30d
commit dea4c0dffe
10 changed files with 44 additions and 44 deletions
+17
View File
@@ -3,6 +3,7 @@ Explosions: creation of shockwave and particles at a given point.
-}
module Dodge.WorldEvent.Explosion (
makeExplosionAt,
makeSmallExplosionAt,
makeFlameExplosionAt,
makePoisonExplosionAt,
makeTeslaExplosionAt,
@@ -80,3 +81,19 @@ makeExplosionAt p vel w =
mF v damp = makeFlamelet p (v + damp *^ vel)
newFs = zipWith4 mF fVs fdamps sizes times
addFlames w' = foldl' (&) w' newFs
makeSmallExplosionAt :: Point3 -> Point3 -> World -> World
makeSmallExplosionAt p vel w =
w
& soundStart (Explosion (w ^. cWorld . lWorld . lClock)) (p ^. _xy) bangS Nothing
& addFlames
& cWorld . lWorld . worldEvents .:~ MakeTempLight (LSParam p 150 (V3 1 0.5 0)) 20
& makeShockwaveAt [] p 40 100 1 white
where
fVs = fmap (`v2z` 0) $ replicateM 5 (randInCirc 2) & evalState $ _randGen w
fdamps = replicateM 100 (state $ randomR (0, 1)) & evalState $ _randGen w
sizes = randomRs (2, 9) $ _randGen w
times = randomRs (15, 20) $ _randGen w
mF v damp = makeFlamelet p (v + damp *^ vel)
newFs = zipWith4 mF fVs fdamps sizes times
addFlames w' = foldl' (&) w' newFs