Fix bug when forming convex hull of game room bounds

This commit is contained in:
2021-09-30 23:46:59 +01:00
parent cb23960bd7
commit 1414d08d88
14 changed files with 51 additions and 16 deletions
+1
View File
@@ -25,5 +25,6 @@ data Room = Room
, _rmFloor :: [Tile]
, _rmName :: String
, _rmShift :: (Point2, Float)
, _rmViewpoints :: [Point2]
}
makeLenses ''Room
+1
View File
@@ -76,6 +76,7 @@ shiftRoomBy shift r = r
. (tileZero %~ shiftPointBy shift )
. (tileX %~ shiftPointBy shift )
)
& rmViewpoints %~ map (shiftPointBy shift)
shiftLinkBy
:: (Point2,Float)
+2 -1
View File
@@ -48,6 +48,7 @@ twinSlowDoorRoom w h x = defaultRoom
]
, _rmBound = ps
, _rmName = "twinSlowDoorRoom"
, _rmViewpoints = [V2 0 h]
}
where
wlSpeed = 0.5
@@ -62,7 +63,7 @@ twinSlowDoorRoom w h x = defaultRoom
[rectNSWE h 0 (-w) w
,rectNSWE 20 (-h) (negate x) x
]
cond' btid w' = (_btState $ _buttons w' IM.! btid) == BtOn
cond' btid w' = _btState (_buttons w' IM.! btid) == BtOn
col = dim $ dim $ bright red
twinSlowDoorChasers