Commit before attempting to allow for non-convex chasm shapes

This commit is contained in:
2025-10-05 15:06:19 +01:00
parent b3924fb8b8
commit 43db5a2ebc
25 changed files with 333 additions and 303 deletions
+15 -14
View File
@@ -106,7 +106,6 @@ craftItemSPic = \case
colorSH green $
upperPrismPolyST 1 (square 4)
<> upperPrismPolyST 2 (rectNSWE 4 (-4) 3 4)
LED -> colorSH yellow $ upperPrismPolyST 1 (square 2)
NAILBOX -> colorSH green $ upperPrismPolyST 3 (rectXH 4 3)
IRONBAR -> colorSH (greyN 0.5) $ upperPrismPolyST 3 $ rectXH 8 2
LIGHTSENSOR ->
@@ -250,7 +249,7 @@ backpackShape = upperPrismPolyMT 10 $ rectNSWE 5 (-5) (-4) 4
heldItemSPic :: HeldItemType -> Item -> SPic
heldItemSPic ht it = case ht of
FLATSHIELD -> flatShieldEquipSPic
TORCH -> noPic torchShape
LED -> noPic torchShape
BANGSTICK i -> noPic $ baseStickShapeX it i -- <> addBullets it
PISTOL -> noPic baseStickShape
MACHINEPISTOL -> noPic baseStickShape
@@ -291,18 +290,20 @@ heldItemSPic ht it = case ht of
KEYCARD _ -> noShape (setDepth 0 $ translate (-5) (-5) $ rotate (pi / 2.5) keyPic)
torchShape :: Shape
torchShape =
colorSH blue $
translateSHxy 0 1.5 side
<> translateSHxy 0 (-1.5) side
<> translateSHz 2.5 top
<> translateSHz (-0.5) bot
<> back
where
side = upperPrismPolySE 3 $ rectXH 10 0.5
top = upperPrismPolySE 0.5 $ rectXH 10 2
bot = upperPrismPolySE 0.5 $ rectXH 9 2
back = upperPrismPolySE 3 $ rectXH 1 2
torchShape = colorSH blue $ upperPrismPolySE 3 $ rectWH 3 3
-- side = upperPrismPolySE 3 $ rectXH 10 0.5
-- colorSH blue $
-- translateSHxy 0 1.5 side
-- <> translateSHxy 0 (-1.5) side
-- <> translateSHz 2.5 top
-- <> translateSHz (-0.5) bot
-- <> back
-- where
-- side = upperPrismPolySE 3 $ rectXH 10 0.5
-- top = upperPrismPolySE 0.5 $ rectXH 10 2
-- bot = upperPrismPolySE 0.5 $ rectXH 9 2
-- back = upperPrismPolySE 3 $ rectXH 1 2
baseStickShapeX :: Item -> Int -> Shape
baseStickShapeX _ _ = mempty