Keep track of seen walls in external list

This commit is contained in:
2023-01-03 22:36:44 +00:00
parent 5b4e8d75bb
commit 0b7da0489a
10 changed files with 30 additions and 727 deletions
+3 -8
View File
@@ -34,22 +34,17 @@ colCrWall w c
--c' = c & crPos %~ pushOutFromWalls' rad (reverse ls)
c' =
c & crPos
%~ pushOutFromCorners rad ls'
. pushOutFromWalls rad ls'
%~ pushOutFromCorners r ls'
. pushOutFromWalls r ls'
. fst
. flip (collidePoint p1) wls -- check push throughs
-- . flip (collidePointWalls' p1) wls -- check push throughs
rad = _crRad c + wallBuffer
r = _crRad c + wallBuffer
p1 = _crOldPos c
p2 = _crPos c
ls = _wlLine <$> wls
ls' = filter (uncurry $ isLHS p1) ls
--wls = filter (not . _wlWalkable) $ wlsNearPoint p2 w
wls = filter (not . _wlWalkable) $ wlsNearRect (p2 +.+ V2 r r) (p2 -.- V2 r r) w
r = _crRad c
--wls = filter (not . _wlWalkable) $ IM.elems $ _walls $ _lWorld $ _cWorld w
--wallPoints = map fst ls
-- the amount to push creatures out from walls, extra to their radius
wallBuffer :: Float