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
+1 -1
View File
@@ -39,7 +39,7 @@ crMvAbsolute :: LWorld -> Point2 -> Creature -> Creature
crMvAbsolute lw p' cr =
cr
& crPos . _xy +~ p
& crMvDir .~ argV p
& crMvDir .~ argV (p + cr ^. crOldPos . _xy - cr ^. crOldOldPos . _xy)
where
p = strengthFactor (getCrMoveSpeed lw cr) *.* p'
+1 -1
View File
@@ -8,7 +8,7 @@ crMvType :: Creature -> CrMvType
crMvType cr = case _crType cr of
Avatar {} -> MvWalking 1.5
ChaseCrit {} -> defaultChaseMvType
HoverCrit {} -> defaultChaseMvType & mvSpeed .~ 0.1
HoverCrit {} -> defaultChaseMvType & mvSpeed .~ 0.15
SwarmCrit -> defaultChaseMvType
AutoCrit -> defaultAimMvType
BarrelCrit {} -> defaultAimMvType
+1 -1
View File
@@ -26,7 +26,7 @@ updateCarriage' cid cr w = \case
(chooseFootSound ff)
Nothing
& over (cWorld . lWorld . creatures . ix cid . crType) resetStride
& tocr . crPos +~ 0.1 *^ (cr ^. crOldPos - oop)
& tocr . crPos +~ 0.5 *^ (cr ^. crOldPos - oop)
_ -> w & tocr . crPos +~ 0.5 *^ (cr ^. crOldPos - oop)
Floating -> w
Flying {_zSpeed = dz, _flyInertia = x} ->
+6 -5
View File
@@ -117,7 +117,8 @@ wasdAim inp w cr
setposture Aiming (-twoHandTwistAmount)
| SDL.ButtonRight `M.member` _mouseButtons inp = aimTurn (w ^. cWorld . lWorld) mousedir cr
| Aiming{} <- cr ^. crStance . posture = setposture AtEase twoHandTwistAmount
| otherwise = creatureTurnTowardDir (_crMvAim cr) 0.2 cr
-- | otherwise = creatureTurnTowardDir (_crMvAim cr) 0.2 cr
| otherwise = creatureTurnTowardDir (_crMvDir cr) 0.2 cr
where
setposture x r =
cr
@@ -134,11 +135,11 @@ twoHandTwistAmount :: Float
twoHandTwistAmount = 1.6 * pi
wasdMovement :: LWorld -> Input -> Camera -> Float -> Creature -> Creature
wasdMovement lw inp cam speed = theMovement . setMvAim
wasdMovement lw inp cam speed = theMovement -- . setMvAim
where
setMvAim = fromMaybe id $ do
dir <- safeArgV movDir
return $ crMvAim .~ (cam ^. camRot + dir)
-- setMvAim = fromMaybe id $ do
-- dir <- safeArgV movDir
-- return $ crMvAim .~ (cam ^. camRot + dir)
movDir = wasdDir inp
movAbs = rotateV (cam ^. camRot) $ normalizeV movDir
theMovement