Continue tweaking movement, remove _crMvAim
This commit is contained in:
@@ -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'
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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} ->
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user