Tweak slime wall collisions, all creatures cliff collisions (min 10)

This commit is contained in:
2026-05-02 19:46:12 +01:00
parent b7aea0eb1f
commit b827827951
6 changed files with 29 additions and 12 deletions
+7 -2
View File
@@ -87,7 +87,7 @@ walkCliffPush :: Creature -> [(Point2,Point2)] -> Point2
walkCliffPush cr xs = pushAgainst (cr ^. crOldPos . _xy - cr ^. crOldOldPos . _xy) (-h xs)
where
cxy = cr ^. crPos . _xy
h = circSegsInside cxy (cr ^. crType . to crRad)
h = circSegsInside cxy (min 10 (cr ^. crType . to crRad))
groundCliffPush :: Creature -> [(Point2,Point2)] -> Point2
groundCliffPush cr xs = x *^ circSegsInside cxy r xs
@@ -138,9 +138,14 @@ chasmTestCliffPush f' cr w
where
cxy = cr ^. crPos . _xy
tocr = cWorld . lWorld . creatures . ix (_crID cr)
g = uncurry $ crOnSeg cr
--g = uncurry $ crOnSeg cr
g = uncurry $ crOnSeg' cr
f = pointInPoly cxy
crOnSeg' :: Creature -> Point2 -> Point2 -> Bool
{-# INLINE crOnSeg' #-}
crOnSeg' cr = circOnSeg (cr ^. crPos . _xy) (min 10 (cr ^. crType . to crRad))
chasmRotate :: Creature -> Point2 -> World -> World
chasmRotate cr v w
| t = rotateTo8 (argV v) w