From ab1b939e3d787e38537169d1a74546bc425cc6ef Mon Sep 17 00:00:00 2001 From: justin Date: Wed, 25 Jun 2025 15:01:20 +0100 Subject: [PATCH] Tweak dust --- src/Dodge/Update.hs | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/Dodge/Update.hs b/src/Dodge/Update.hs index d9878a52e..4fe2860ad 100644 --- a/src/Dodge/Update.hs +++ b/src/Dodge/Update.hs @@ -616,7 +616,7 @@ updateClouds :: World -> World updateClouds = updateObjCatMaybes clouds updateCloud updateDusts :: World -> World -updateDusts = updateObjCatMaybes dusts updateDust +updateDusts w = updateObjMapMaybe dusts (updateDust w) w --updateBeams :: World -> World --updateBeams w = @@ -764,21 +764,19 @@ updateCloud w c finalPos = addZ (max 1 $ min 90 npz) $ maybe newPos2 fst hitWl finalVel = addZ nvz $ maybe newVel2 snd hitWl -updateDust :: World -> Dust -> (World, Maybe Dust) +updateDust :: World -> Dust -> Maybe Dust updateDust w c - | _dsTimer c < 1 = (w, Nothing) + | _dsTimer c < 1 = Nothing | otherwise = - ( w - , Just $ + Just $ c & dsPos .~ finalpos & dsVel .~ newvel & dsTimer -~ 1 - ) where springvel = foldl' (dustSpringVel c) (_dsVel c) (dssNearPoint oldPos2 w) v@(V3 _ _ vz) = springvel - newvel = 0.9 * (maybe v (addZ vz . snd) hitWl - V3 0 0 0.05) + newvel = 0.95 * (maybe v (addZ vz . snd) hitWl - V3 0 0 0.05) oldPos = _dsPos c oldPos2 = stripZ oldPos newPos@(V3 _ _ npz) = oldPos + v