Add bee crits
This commit is contained in:
@@ -28,7 +28,8 @@ updateCarriage' cid cr w = \case
|
||||
& chasmTestCliffPush walkCliffPush cr
|
||||
Crawling -> w & chasmTestCliffPush walkCliffPush cr
|
||||
Floating -> w
|
||||
Flying {_zSpeed = dz, _flyInertia = x} ->
|
||||
Flying {_zSpeed = dz} -> let x = flyInertia cr
|
||||
in
|
||||
w & tocr . crPos . _xy +~ x *^ f (cr ^. crOldPos . _xy - oop ^. _xy)
|
||||
& tocr . crPos . _z +~ dz
|
||||
& tocr . crStance . carriage . zSpeed
|
||||
@@ -48,12 +49,19 @@ updateCarriage' cid cr w = \case
|
||||
OnGround {} -> w
|
||||
& tocr . crPos . _xy +~ 0.8 *^ (cr ^. crOldPos . _xy - oop ^. _xy)
|
||||
& chasmTestCliffPush groundCliffPush cr
|
||||
Rooted {} -> w
|
||||
Mounted mid p -> fromMaybe w $ do
|
||||
mp <- w ^? cWorld . lWorld . creatures . ix mid . crPos
|
||||
return $ w & tocr . crPos .~ mp + p
|
||||
where
|
||||
tocr = cWorld . lWorld . creatures . ix cid
|
||||
oop = cr ^. crOldOldPos
|
||||
f v | norm v > 10 = 10 *^ signorm v
|
||||
| otherwise = v
|
||||
|
||||
flyInertia :: Creature -> Float
|
||||
flyInertia _ = 0.975
|
||||
|
||||
pushAgainst :: Point2 -> Point2 -> Point2
|
||||
pushAgainst x y
|
||||
| a > norm y = 0
|
||||
|
||||
Reference in New Issue
Block a user