Readd block obstruction field
This commit is contained in:
+1
-1
@@ -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
|
||||
|
||||
@@ -14,6 +14,7 @@ defaultBlock = Block
|
||||
, _blDir = 0
|
||||
, _blDraw = const mempty
|
||||
, _blDeath = makeBlockDebris
|
||||
, _blObstructs = []
|
||||
}
|
||||
defaultDirtBlock :: Block
|
||||
defaultDirtBlock = defaultBlock & blHP .~ 50
|
||||
|
||||
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user