This commit is contained in:
2025-10-29 12:18:55 +00:00
parent c9ec962575
commit 40c1907689
5 changed files with 11 additions and 16 deletions
+2 -5
View File
@@ -8,6 +8,7 @@ module Dodge.WorldEvent.Explosion (
makeTeslaExplosionAt,
) where
import Linear
import Control.Monad
import Data.List
import Dodge.Data.World
@@ -19,8 +20,6 @@ import Geometry
import LensHelp
import Picture
import RandomHelp
import Linear.V3
import Linear.Metric
makePoisonExplosionAt ::
-- | Position
@@ -72,19 +71,17 @@ makeFlameExplosionAt p w =
makeExplosionAt :: Point3 -> Point3 -> World -> World
makeExplosionAt p vel w =
--makeExplosionAt p _ 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 50 100 1 white
-- & makeShockwaveAt [] p 50 5000 1 white
where
fVs = fmap (`v2z` 0) $ replicateM 100 (randInCirc 1) & evalState $ _randGen w
fPs' = fmap (`v2z` 0) $ replicateM 100 (randInCirc 5) & evalState $ _randGen w
fdamps = replicateM 100 (state $ randomR (0,1)) & evalState $ _randGen w
inversePushOut v = (15 - norm v) * 0.01 *.*.* v
inversePushOut v = (15 - norm v) * 0.01 *^ v
fVs' = zipWith (+.+.+) fVs $ map inversePushOut fPs'
sizes = randomRs (2, 9) $ _randGen w
times = randomRs (15, 20) $ _randGen w