Tweak explosions

This commit is contained in:
2024-12-27 23:44:39 +00:00
parent ed5c5d7b8a
commit 1507b8d3ed
2 changed files with 5 additions and 3 deletions
+2 -1
View File
@@ -118,7 +118,8 @@ doThrust pj smoke w =
& randGen .~ g
& cWorld . lWorld . projectiles . ix i . prjVel %~ (\v -> accel +.+ frict *.* v)
& soundContinue (ShellSound i) newPos missileLaunchS (Just 1)
& makeFlamelet (oldPos -.- vel) (vel +.+ rotateV (pi + sparkD) accel) 3 10
-- & makeFlamelet (oldPos -.- vel) (vel + 2 * rotateV (pi + sparkD) accel) 3 10
& makeFlamelet oldPos (vel +.+ rotateV (pi + sparkD) accel) 3 10
& shellTrailCloud
lifetime
trailfadetime
+3 -2
View File
@@ -80,10 +80,11 @@ makeExplosionAt p vel w =
where
fVs = replicateM 100 (randInCirc 1) & evalState $ _randGen w
fPs' = replicateM 100 (randInCirc 5) & evalState $ _randGen w
fdamps = replicateM 100 (state $ randomR (0,1)) & evalState $ _randGen w
inversePushOut v = (15 - magV v) * 0.01 *.* v
fVs' = zipWith (+.+) fVs $ map inversePushOut fPs'
sizes = randomRs (2, 9) $ _randGen w
times = randomRs (15, 20) $ _randGen w
mF q v size time = makeFlamelet (q - (2*v + 2* vel)) (v + vel) size time
newFs = zipWith3 (mF p) (zipWith (+) fPs' (fmap (3 *.*) fVs')) sizes times
mF q v damp size time = makeFlamelet (q - (2*v + 2* vel)) (v + damp *.* vel) size time
newFs = zipWith4 (mF p) (zipWith (+) fPs' (fmap (3 *.*) fVs')) fdamps sizes times
addFlames w' = foldl' (flip ($)) w' newFs