Make "tanks" into Blocks
This commit is contained in:
@@ -28,8 +28,8 @@ addBlock (p:ps) wl bl w = w
|
||||
& walls %~ IM.union panes
|
||||
& blocks %~ IM.insert blid bl
|
||||
{_blID = blid,_blWallIDs = IS.fromList is, _blShadows=[]
|
||||
, _blFootprint = p:ps, _blPos = centroid (p:ps), _blDraw = const mempty
|
||||
, _blDeath = makeBlockDebris}
|
||||
, _blFootprint = p:ps
|
||||
}
|
||||
where
|
||||
blid = IM.newKey $ _blocks w
|
||||
lns = zip (p:ps) (ps ++ [p])
|
||||
@@ -85,6 +85,7 @@ placeLineBlock basePane blockWidth depth a b gw = ( 0
|
||||
insertBlock (i,p) = over blocks $ IM.insert (i+blid) Block
|
||||
{ _blID = i + blid, _blWallIDs = IS.fromList $ ksAtI i
|
||||
, _blHP = 1000, _blShadows = shadowsAt i
|
||||
, _blRot = 0 -- THIS IS NOT SENSIBLE. TODO rethink block positioning
|
||||
, _blFootprint = cornersAt p -- TODO check winding (clockwise, anticlockwise)
|
||||
, _blPos = p, _blDraw = const mempty , _blDeath = makeBlockDebris}
|
||||
insertBlocks = flip (foldr insertBlock) $ zip is blockCenPs
|
||||
|
||||
Reference in New Issue
Block a user