Keep track of seen walls in external list
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user