From 736d0494c4199289e723938f78c388329ba81d82 Mon Sep 17 00:00:00 2001 From: justin Date: Fri, 2 Jan 2026 20:03:25 +0000 Subject: [PATCH] Improve minigun spinning shape --- src/Dodge/Item/Draw/SPic.hs | 11 ++++++++--- src/Shape.hs | 6 +++--- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/Dodge/Item/Draw/SPic.hs b/src/Dodge/Item/Draw/SPic.hs index 932d83aa4..cb46a68dc 100644 --- a/src/Dodge/Item/Draw/SPic.hs +++ b/src/Dodge/Item/Draw/SPic.hs @@ -365,9 +365,14 @@ volleyGunShape i = -- to get this rotating should probably add extra state to the minigun miniGunXPictItem :: Int -> Item -> SPic -miniGunXPictItem i it = miniGunXPict i (_wTime (_itParams it) - 10) +miniGunXPictItem i it = miniGunXPict i (f $ _wTime (_itParams it)) + where + f x = y * (y + z) / (100 +z) + where + z = 0 + y = fromIntegral x -miniGunXPict :: Int -> Int -> SPic +miniGunXPict :: Int -> Float -> SPic miniGunXPict i spin = noPic . colorSH red $ rotateSHx a barrels @@ -375,7 +380,7 @@ miniGunXPict i spin = where aBarrel = translateSH (V3 15 4 2.5) $ xCylinderST 2 25 barrels = foldMap (\an -> aBarrel & rotateSHx (2 * pi * fromIntegral an / fromIntegral i)) [1 .. i] - a = fromIntegral spin / 100 + a = 2 * pi * spin / 25 --x = fromIntegral am / 10 -- clip y z = translateSH (V3 0 (-1) z) (rotateSHx (negate $ pi/4) diff --git a/src/Shape.hs b/src/Shape.hs index 66efe9524..5872bd77f 100644 --- a/src/Shape.hs +++ b/src/Shape.hs @@ -134,12 +134,12 @@ xCylinder :: Size -> Importance -> Float -> Float -> Shape xCylinder size shad d x = translateSHz r . rotateSHq (V3 0 1 0) (pi / 2) . upperCylinder size shad x $ [ V2 r r - , V2 (-r) (r) - , V2 (-r) (-r) + , V2 (-r*0.5) (r*0.5) + , V2 (-r*0.5) (-r*0.5) , V2 r (- r) ] where - r = 0.5 * d + r = d upperBoxMT :: Float -> [Point2] -> Shape upperBoxMT = upperBox Medium Typical