Tweak explosions

This commit is contained in:
2024-12-24 14:54:32 +00:00
parent a79dfa1bb3
commit c4b9142d0f
8 changed files with 19 additions and 14 deletions
+5 -4
View File
@@ -70,8 +70,8 @@ makeFlameExplosionAt p w =
-- the ( Nthing :: Maybe Int ) here is "maybe" a creature id that the
-- particle passes through for the first frame of its existence
makeExplosionAt :: Point2 -> World -> World
makeExplosionAt p w =
makeExplosionAt :: Point2 -> Point2 -> World -> World
makeExplosionAt p vel w =
w
& soundMultiFrom [Explosion 0, Explosion 1] p bangS Nothing
& addFlames
@@ -93,8 +93,9 @@ makeExplosionAt p w =
fVs' = zipWith (+.+) fVs $ map inversePushOut fPs'
sizes = randomRs (2, 9) $ _randGen w
times = randomRs (15, 20) $ _randGen w
mF q z v size time = makeFlamelet q z v size time
newFs = zipWith5 mF fPs zs (fmap (3 *.*) fVs') sizes times
mF q z v size time = makeFlamelet (q - vel) z (v + vel) size time
--newFs = zipWith5 mF fPs zs (fmap (3 *.*) fVs') sizes times
newFs = zipWith4 (mF p) zs (zipWith ((+) . xyV3) fPs'' (fmap (3 *.*) fVs')) sizes times
addFlames w' = foldl' (flip ($)) w' newFs
--pushAgainstWalls q = maybe q (uncurry (+.+)) $ reflectPointWalls p q wls
--pushAgainstWalls q = maybe q fst $ reflectPointWalls p q wls