Work on slime crits
This commit is contained in:
+9
-5
@@ -1019,8 +1019,8 @@ crCrSpring c1 c2
|
||||
return $ z c1 > h2 || z c2 > h1
|
||||
olap a b = ix (a ^. crID) . crPos . _xy +~ overlap b
|
||||
olap' a b = ix (a ^. crID) . crPos . _xy -~ overlap b
|
||||
suckx = min 1 (2 * (1 - distance xy1 xy2 / (r1 + r2)))
|
||||
rolap = ix id1 . crPos . _xy +~ (2*m2 / (m1+m2)) *^ normalize (xy2 - xy1)
|
||||
suckx = min 1 $ 2 * (1 - distance xy1 xy2 / (r1 + r2))
|
||||
rolap = ix id1 . crPos . _xy +~ (suckx * 1.5 * m2 / (m1+m2)) *^ normalize (xy2 - xy1)
|
||||
rolap' = ix id2 . crPos . _xy +~ (suckx * 1.5*m1 / (m1+m2)) *^ normalize (xy1 - xy2)
|
||||
id1 = _crID c1
|
||||
id2 = _crID c2
|
||||
@@ -1037,14 +1037,18 @@ crCrSpring c1 c2
|
||||
m2 = crMass $ c2 ^. crType
|
||||
|
||||
fuseSlimes :: Creature -> Creature -> World -> World
|
||||
fuseSlimes c1 c2 = (cWorld . lWorld . creatures . ix i1 .~ c)
|
||||
. (cWorld . lWorld . creatures . at i2 .~ Nothing)
|
||||
fuseSlimes c1 c2 = (cWorld . lWorld . creatures . ix mini .~ (c & crID .~ mini))
|
||||
. (cWorld . lWorld . creatures . at maxi .~ Nothing)
|
||||
where
|
||||
mini = min i1 i2
|
||||
maxi = max i1 i2
|
||||
i1 = c1 ^. crID
|
||||
i2 = c2 ^. crID
|
||||
c = c1 & crType . slimeRad .~ r
|
||||
& crType . slimeRadWobble +~ r - max r1 r2
|
||||
& crType . slimeCompression .~ V2 r 0
|
||||
& crPos . _xy .~ (r1/(r1+r2)) *^ xy1 + (r2/(r1+r2)) *^ xy2
|
||||
-- & crPos . _xy .~ (r1/(r1+r2)) *^ xy1 + (r2/(r1+r2)) *^ xy2
|
||||
& crPos . _xy .~ if r1 > r2 then xy1 else xy2
|
||||
xy1 = c1 ^. crPos . _xy
|
||||
xy2 = c2 ^. crPos . _xy
|
||||
r1 = c1 ^?! crType . slimeRad
|
||||
|
||||
Reference in New Issue
Block a user