Better check for wall collisions when expanding creature

This commit is contained in:
2021-11-19 23:22:49 +00:00
parent 51d89982ed
commit 9f4ff3a75a
4 changed files with 34 additions and 23 deletions
+2 -1
View File
@@ -367,7 +367,8 @@ collidePointCrsWithoutPoint cid p1 p2 w
$ _creatures w
where
f (cID,(p,_)) = (p,cID)
{- | Test if a circle collides with any wall. -}
{- | Test if a circle collides with any wall.
- Note no check on whether the wall is walkable. -}
circOnSomeWall :: Point2 -> Float -> World -> Bool
circOnSomeWall p rad w
= any (\(x,y) -> circOnSeg x y p rad)