Continue tweaking movement, remove _crMvAim

This commit is contained in:
2026-04-03 20:50:41 +01:00
parent 47ecfb7fd3
commit dc30f7ca15
9 changed files with 18 additions and 15 deletions
+2 -2
View File
@@ -280,8 +280,8 @@ functionalUpdate =
. over uvWorld (cWorld . lWorld . lClock +~ 1)
. over uvWorld updateDistortions
. over uvWorld updateCreatureSoundPositions
. over uvWorld pushYouOutFromWalls
. over uvWorld updateCreatureStrides
. over uvWorld pushYouOutFromWalls
. colCrsWalls
. over uvWorld simpleCrSprings
. over uvWorld updateDoors
@@ -374,7 +374,7 @@ updateCreatureStrides = cWorld . lWorld . creatures . each %~ updateCreatureStri
updateCreatureStride :: Creature -> Creature
updateCreatureStride cr = cr & crType . strideAmount +~ d
where
s = fromMaybe 0 $ crMvType cr ^? mvSpeed
s = 2 * fromMaybe 1 (crMvType cr ^? mvSpeed)
-- d = min s . norm $ cr ^. crPos - cr ^. crOldPos
d = max 0 . min s $ dotV (cr ^. crPos . _xy - cr ^. crOldPos . _xy) (unitVectorAtAngle (cr ^. crMvDir))