Add shatterGun

This commit is contained in:
2022-06-16 11:13:44 +01:00
parent 6d5d651566
commit fa762c7687
13 changed files with 98 additions and 15 deletions
+2 -2
View File
@@ -34,7 +34,7 @@ addBlock (p:ps) wl hp hps bm w
& blocks %~ IM.insert blid Block
{_blID = blid,_blWallIDs = IS.fromList is, _blHPs = hp:hps, _blShadows=[], _blMaterial = bm
, _blFootprint = p:ps, _blPos = centroid (p:ps), _blDraw = const mempty
, _blDeath = makeBlockDebris bm}
, _blDeath = makeBlockDebris}
where
blid = IM.newKey $ _blocks w
lns = zip (p:ps) (ps ++ [p])
@@ -92,7 +92,7 @@ placeLineBlock basePane bm blockWidth depth a b gw = ( 0
{ _blID = i + blid, _blWallIDs = IS.fromList $ ksAtI i
, _blHPs = [5,5], _blShadows = shadowsAt i, _blMaterial = bm
, _blFootprint = cornersAt p -- TODO check winding (clockwise, anticlockwise)
, _blPos = p, _blDraw = const mempty , _blDeath = makeBlockDebris bm}
, _blPos = p, _blDraw = const mempty , _blDeath = makeBlockDebris}
insertBlocks = flip (foldr insertBlock) $ zip is blockCenPs
ksAtI i = map ( + (wlid + i*4) ) [0,1,2,3]
visibilityAt i