Fix slime splitting position

This commit is contained in:
2026-04-16 00:02:13 +01:00
parent 7fee343d00
commit a060ed817c
2 changed files with 5 additions and 2 deletions
+4 -2
View File
@@ -149,12 +149,14 @@ splitSlimeCrit p v cr = do
a2 = pi*r*r - a1
r1 = sqrt (a1/pi)
r2 = sqrt (a2/pi)
mvdir = normalize (vNormal v)
mvdir
| isLHS p (p+v) cxy = normalize (vNormal v)
| otherwise = - normalize (vNormal v)
return (cr' & crPos . _xy .~ mp + (r1 + 0.51) *^ mvdir
& crType . slimeRad .~ r1
& crType . slimeCompression .~ rotateV (argV mvdir) (V2 r1 0)
& crDir .~ argV mvdir
,cr' & crPos . _xy .~ mp - (r2 + 0.51) *^ normalize mvdir
,cr' & crPos . _xy .~ mp - (r2 + 0.51) *^ mvdir
& crType . slimeRad .~ r2
& crType . slimeCompression .~ rotateV (argV (-mvdir)) (V2 r2 0)
& crDir .~ argV (-mvdir)
+1
View File
@@ -1045,6 +1045,7 @@ slimeFood :: Creature -> Bool
slimeFood cr = case cr ^. crType of
Avatar{} -> True
ChaseCrit{} -> True
CrabCrit {} -> True
_ -> False
feedSlime :: Creature -> Creature -> World -> World