Check wall collisions when expanding

This commit is contained in:
2021-11-18 21:15:50 +00:00
parent a546d070f0
commit 15f2c419d2
7 changed files with 58 additions and 36 deletions
+4 -4
View File
@@ -108,9 +108,7 @@ renderItemMapAt :: Float -> Float -> World -> IM.IntMap Item -> Picture
renderItemMapAt tx ty w = concatMapPic (uncurry $ listItemAt tx ty w) . IM.toList
displayInv :: Int -> World -> Picture
displayInv n w = renderItemMapAt 0 0 w items
where
items = _crInv $ _creatures w IM.! n
displayInv n w = renderItemMapAt 0 0 w . _crInv $ _creatures w IM.! n
drawLocations :: World -> Picture
drawLocations w = pictures $
@@ -204,7 +202,9 @@ itemText :: Item -> Picture
itemText NoItem = text "----"
itemText it = case _itCurseStatus it of
UndroppableIdentified -> color black (text (_itInvDisplay it it))
<> color (withAlpha 0.5 thecolor) (polygon (rectNSEW 120 (-70) 900 (-100)))
<> color (withAlpha 0.9 thecolor) (polygon (rectNSEW 110 (-65) 885 (-90)))
-- <> color (withAlpha 0.9 thecolor) (polygon (rectNSEW 115 (-70) 895 (-95)))
-- <> color (withAlpha 0.9 thecolor) (polygon (rectNSEW 120 (-70) 900 (-100)))
_ -> color thecolor $ text (_itInvDisplay it it)
where
thecolor = _itInvColor it