Readd block obstruction field

This commit is contained in:
2022-07-01 18:58:21 +01:00
parent fc5d1348d9
commit ca40f315c0
3 changed files with 3 additions and 1 deletions
+1 -1
View File
@@ -357,7 +357,6 @@ data Creature = Creature
, _crMvDir :: Float
, _crTwist :: Float
, _crID :: Int
--, _crPict :: Creature -> Configuration -> World -> SPic
, _crPict :: Creature -> SPic
, _crSkin :: CreatureSkin
, _crUpdate :: Creature -> World -> World
@@ -945,6 +944,7 @@ data Block = Block
, _blHP :: Int
, _blShadows :: [Int] -- a list of blocks/walls? that are not shown when this block exists
, _blFootprint :: [Point2]
, _blObstructs :: [(Point2,Point2)]
, _blPos :: Point2
, _blDir :: Float
, _blDraw :: Block -> SPic
+1
View File
@@ -14,6 +14,7 @@ defaultBlock = Block
, _blDir = 0
, _blDraw = const mempty
, _blDeath = makeBlockDebris
, _blObstructs = []
}
defaultDirtBlock :: Block
defaultDirtBlock = defaultBlock & blHP .~ 50
+1
View File
@@ -88,6 +88,7 @@ placeLineBlock basePane blockWidth depth a b gw = ( 0
, _blHP = 1000, _blShadows = shadowsAt i
, _blDir = 0 -- THIS IS NOT SENSIBLE. TODO rethink block positioning
, _blFootprint = cornersAt p -- TODO check winding (clockwise, anticlockwise)
, _blObstructs = []
, _blPos = p, _blDraw = const mempty , _blDeath = makeBlockDebris}
insertBlocks = flip (foldr insertBlock) $ zip is blockCenPs
ksAtI i = map ( + (wlid + i*4) ) [0,1,2,3]